https://github.com/pallets-eco/flask-session
Server side session extension for Flask
https://github.com/pallets-eco/flask-session
flask sessions
Last synced: 23 days ago
JSON representation
Server side session extension for Flask
- Host: GitHub
- URL: https://github.com/pallets-eco/flask-session
- Owner: pallets-eco
- License: bsd-3-clause
- Created: 2014-04-25T11:48:29.000Z (about 11 years ago)
- Default Branch: development
- Last Pushed: 2024-12-23T22:22:20.000Z (5 months ago)
- Last Synced: 2025-05-03T01:13:07.518Z (about 1 month ago)
- Topics: flask, sessions
- Language: Python
- Homepage: https://flask-session.readthedocs.io
- Size: 1.53 MB
- Stars: 523
- Watchers: 21
- Forks: 243
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE.rst
- Security: docs/security.rst
Awesome Lists containing this project
- jimsghstars - pallets-eco/flask-session - Server side session extension for Flask (Python)
- best-of-web-python - GitHub - 6% open · ⏱️ 18.04.2024): (Flask Utilities)
README
# Flask-Session
Flask-Session is an extension for Flask that adds support for server-side sessions to your application.








## Installing
Install and update using pip:
```py
$ pip install flask-session[redis]
```You can include any supported storage type in place of redis.
## A Simple Example
```py
from flask import Flask, session
from flask_session import Sessionapp = Flask(__name__)
# Check Configuration section for more details
SESSION_TYPE = 'redis'
app.config.from_object(__name__)
Session(app)@app.route('/set/')
def set():
session['key'] = 'value'
return 'ok'@app.route('/get/')
def get():
return session.get('key', 'not set')
```## Supported Storage Types
- Redis
- Memcached
- FileSystem
- MongoDB
- SQLALchemy
- DynamoDB## Documentation
Learn more at the official [Flask-Session Documentation](https://flask-session.readthedocs.io/en/latest/).
## Maintainers
- [Lxstr](https://github.com/Lxstr)
- Pallets Team## Contribute
Thanks to all those who have contributed to Flask-Session. A full list can be found at [CONTRIBUTORS.md](https://github.com/pallets-eco/flask-session/blob/development/CONTRIBUTORS.md).
If you want to contribute, please check the [CONTRIBUTING.rst](https://github.com/pallets-eco/flask-session/blob/development/CONTRIBUTING.rst).
## Donate
The Pallets organization develops and supports Flask-Session and other popular packages. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.