pallets-eco/flask-session

Server side session extension for Flask

Python

534

291 commits

updated Jun 14, 2025

See the code

README

Flask-Session

Flask-Session

Flask-Session is an extension for Flask that adds support for server-side sessions to your application.

GitHub Actions Workflow Status Documentation status BSD-3 Clause License Common Changelog Code style: ruff PyPI - Latest Version PyPI - Python Version Discord PyPI - Downloads

Installing

Install and update using pip:

$ pip install flask-session[redis]

You can include any supported storage type in place of redis.

A Simple Example

from flask import Flask, session
from flask_session import Session

app = 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.

Maintainers

Contribute

Thanks to all those who have contributed to Flask-Session. A full list can be found at CONTRIBUTORS.md.

If you want to contribute, please check the CONTRIBUTING.rst.

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.

flask
sessions

pallets-eco/flask-session

Server side session extension for Flask

Python

534

291 commits

updated Jun 14, 2025

See the code

README

Flask-Session

Flask-Session

Flask-Session is an extension for Flask that adds support for server-side sessions to your application.

GitHub Actions Workflow Status Documentation status BSD-3 Clause License Common Changelog Code style: ruff PyPI - Latest Version PyPI - Python Version Discord PyPI - Downloads

Installing

Install and update using pip:

$ pip install flask-session[redis]

You can include any supported storage type in place of redis.

A Simple Example

from flask import Flask, session
from flask_session import Session

app = 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.

Maintainers

Contribute

Thanks to all those who have contributed to Flask-Session. A full list can be found at CONTRIBUTORS.md.

If you want to contribute, please check the CONTRIBUTING.rst.

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.

flask
sessions

Project health

Overall

4.6/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Latest release

0.8.0 · Mar 26, 2024

Releases this year

0

Significant stargazers

Éloi Rivard

81 followers · starred Nov 2025

Wong Hoi Sing Edison

107 followers · starred May 2025

kyoto7250

13 followers · starred Feb 2025

Konstantin Kovshenin

442 followers · starred Dec 2023