Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/python/aiohttp/examples/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 936 B image not shown  

Quelle  web_cookies.py

  Sprache: Python
 

#!/usr/bin/env python3
"""Example for aiohttp.web basic server with cookies."""

from pprint import pformat
from typing import NoReturn

from aiohttp import web

tmpl = """\
<html>
    <body>
        <a href="/login">Login</a><br/>
        <a href="/logout">Logout</a><br/>
        <pre>{}</pre>
    </body>
</html>"""


async def root(request):
    resp = web.Response(content_type="text/html")
    resp.text = tmpl.format(pformat(request.cookies))
    return resp


async def login(request: web.Request) -> NoReturn:
    exc = web.HTTPFound(location="/")
    exc.set_cookie("AUTH""secret")
    raise exc


async def logout(request: web.Request) -> NoReturn:
    exc = web.HTTPFound(location="/")
    exc.del_cookie("AUTH")
    raise exc


def init():
    app = web.Application()
    app.router.add_get("/", root)
    app.router.add_get("/login", login)
    app.router.add_get("/logout", logout)
    return app


web.run_app(init())

Messung V0.5 in Prozent
C=82 H=93 G=87

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-06-06) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.