Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

flask-session-decoder

Zero-dependency Flask session decoder.

This is a small library without any dependencies. It works with close to default Flask session security configurations, but obviously does not provide the full cookie decoding and verification capabilities of flask / werkzeug / itsdangerous. If your project already depends on these libraries, use the official tooling instead.

Installation and Usage

You can install the library from PyPI with pip install flask-session-decoder.

Once installed, you can import and instantiate the decoder like this:

from flask_session_decoder import FlaskSessionDecoder

decoder = FlaskSessionDecoder(secret_key="the-secret-key-of-the-flask-app-that-created-the-cookie")

FlaskSessionDecoder provides three methods for cookie verification and loading:

  • decoder.load(cookie) returns the (by default verified) decoded string representation of the cookie.
  • decoder.json(cookie) returns the (by default verified) decoded cookie as a dict.
  • verify(cookie) returns whether the cookie signature is valid, without actually loading the value.

Development

Use black for code formatting and mypy for static code analysis.

License - MIT

The library is open-sourced under the conditions of the MIT license.

Metadata

Release files for flask-session-decoder 0.1.0

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

Source distribution (sdist)

Source distribution for flask-session-decoder 0.1.0
File Size Uploaded
flask-session-decoder-0.1.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-session-decoder 0.1.0
File Interpreter ABI Platform
flask_session_decoder-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / flask-session-decoder-0.1.0.tar.gz

Download URL flask-session-decoder-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1a4ad4df12207b61f14ce33c0962c39d322d7aba19153a0f577b80ecfbd448c6
BLAKE2b-256 checksum
How to use checksums
bee74b02f984c9122171f070a843971b16a05e4cf2ae8f9b4e894a1dde92181b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / flask_session_decoder-0.1.0-py3-none-any.whl

Download URL flask_session_decoder-0.1.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54cc21e59a2713a2834cdf07c1cb7e43bdae3551a1142220ea5e398069ee9000
BLAKE2b-256 checksum
How to use checksums
f8d2fc813899cea0a54ad3452fb26b0810e6b486a06c0b214ab29a35cdb22ad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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