Skip to main content

Sanic-CookieSession implements a client side only, cookie-based session to be used with Sanic. Similar to the built-in session in Flask.

Quick Start

Installation

pip install Sanic-CookieSession

How to use it

from sanic import Sanic, response
import sanic_cookiesession

app = Sanic(__name__)
app.config['SESSION_COOKIE_SECRET_KEY'] = 'abcd'

sanic_cookiesession.setup(app)

@app.route('/')
def index(request):
    session = request.ctx.session
    session.setdefault('c', 0)
    session['c'] += 1
    return response.text(session['c'])

if __name__ == '__main__':
    app.run(debug=True)

That’s it.

For more details, please see documentation.

License

BSD New, see LICENSE for details.

Metadata

Release files for Sanic-CookieSession 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Sanic-CookieSession 0.3.1
File Size Uploaded Provenance
sanic_cookiesession-0.3.1.tar.gz 4.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for Sanic-CookieSession 0.3.1
File Interpreter ABI Platform
sanic_cookiesession-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / sanic_cookiesession-0.3.1.tar.gz

Download URL sanic_cookiesession-0.3.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7e5a44c16c8541c9aadb57a616be692ecee57a137ac49a2cc6f61a09c90b0624
BLAKE2b-256 checksum
How to use checksums
0fd2a01227382bffa8f1e2d77f84a7d39b3fc63d1ac81780419f511a2f53f64d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.9.3 CPython/3.11.6

Release files / sanic_cookiesession-0.3.1-py3-none-any.whl

Download URL sanic_cookiesession-0.3.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a40959bf2ea189e59221213ce7ec9b4e89f0943981912f7ee8b3ada5738eb0d
BLAKE2b-256 checksum
How to use checksums
b5948e427ab0e09ef419511f3ef1499df22cf68f2cebd0c84d99fca0df5e3f86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.9.3 CPython/3.11.6

Security for Sanic-CookieSession 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page