Skip to main content

Server-side session support for Flask

Project description



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


Install and update using pip:

$ pip install flask-session

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'

def set():
    session['key'] = 'value'
    return 'ok'

def get():
    return session.get('key', 'not set')

Supported Storage Types

  • Redis

  • Memcached

  • FileSystem

  • MongoDB

  • SQLALchemy


Learn more at the official Flask-Session Documentation.



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

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

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

flask_session-0.7.0.tar.gz (938.5 kB view hashes)

Uploaded Source

Built Distribution

flask_session-0.7.0-py3-none-any.whl (22.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page