403Webshell
Server IP : 127.0.1.1  /  Your IP : 216.73.216.17
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux dalsi.io 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/doc/python3-aiohttp/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/python3-aiohttp/examples/web_cookies.py
#!/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())

Youez - 2016 - github.com/yon3zu
LinuXploit