Simple user session protection
Project description
flask-paranoid
Simple user session protection.
Quick Start
Here is a simple application that uses Flask-Paranoid to protect the user session:
from flask import Flask
from flask_paranoid import Paranoid
app = Flask(__name__)
app.config['SECRET_KEY'] = 'top-secret!'
paranoid = Paranoid(app)
paranoid.redirect_view = '/'
@app.route('/')
def index():
return render_template('index.html')
When a client connects to this application, a "paranoid" token will be generated according to the IP address and user agent. In all subsequent requests, the token will be recalculated and checked against the one computed for the first request. If the session cookie is stolen and the attacker tries to use it from another location, the generated token will be different, and in that case the extension will clear the session and block the request.
Resources
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Flask-Paranoid-0.3.0.tar.gz
.
File metadata
- Download URL: Flask-Paranoid-0.3.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46c049ba701b25f1ccf3988164e1bfb12320ab55f1de66384b012f7767bb8058 |
|
MD5 | a7a112907060e722fb783fe1107c85e3 |
|
BLAKE2b-256 | f0038e4eb2d4e3ffdd436a71f273dc6443c30766b55194a009264ee6eb2c5fde |
File details
Details for the file Flask_Paranoid-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: Flask_Paranoid-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cb48aadfbee5aefe8a75e7436f3a31e426a170a893f022a50e7e4f569ad0850 |
|
MD5 | ae7d469133757255ff47212a4cb92ec0 |
|
BLAKE2b-256 | f3d73c054c416a575bc1775ef506fddd0faef4af734a8047d815c7cbb600eb5a |