Flask-Login
Open SourceUser session management for Flask apps.
Published 27 September 2026
Scores
About Flask-Login
Flask-Login is the standard session-management extension for Flask. Flask itself ships no auth system at all, so Flask-Login fills that specific gap: it tracks which user is logged in across requests, manages remember-me cookies, and provides a login_required decorator to protect views.
It deliberately does not handle password hashing, user storage, or registration — those are left to the app (often paired with a package like Flask-Security or Authlib for OAuth). That minimalism mirrors Flask's own philosophy: Flask-Login is close to the default choice once a Flask project needs sessions at all, but it is one building block, not a complete auth solution.
It works entirely through Flask's own signed session cookie — no server-side session store is required unless the app already uses one — and the optional remember-me cookie is signed with the app's own secret key rather than a separate token system. Because Flask-Login stays silent on passwords, it is routinely paired with Werkzeug's security helpers or Flask-Bcrypt for hashing, and with Flask-WTF for the login form itself.
Key Features
- Tracks the current logged-in user across requests (current_user)
- user_loader callback that works with any user storage
- Remember-me cookie signed with the app's secret key
- login_required decorator for protecting views
- Fresh-login checks for sensitive actions
- request_loader for API-key or header-based authentication
- Anonymous user object for logged-out visitors
Pros
- Minimal and focused — just session handling, so it drops into any Flask app without imposing structure
- The login_required decorator makes protecting views a one-line change
- Works with any user storage or password scheme since it does not dictate either
Cons
- No password hashing, registration, or user storage — those still have to be built or added separately
- No built-in OAuth or social login; needs pairing with a package like Authlib
- Being unopinionated means more decisions and more code for a team that wants auth solved out of the box
Flask-Login Pricing
Open SourceTech Stacks with Flask-Login
HTMX + Flask
ProjectThe simplest way to add dynamic interactions to a Flask app. HTMX attributes in Jinja2 templates, server returns HTML fragments. Perfect for beginners building server-rendered web apps with Python.
Flask + HTML Templates
ProjectMinimal Flask app serving Jinja2 HTML templates, great for small projects and prototypes.
Replit + Flask
ProjectBuild and host a Python Flask web app in Replit's browser-based IDE. No local Python install, no deployment config: write your Flask routes, hit Run, and share the live URL instantly.
Tools Related to Flask-Login
Part of(1)
Flask-Login is a third-party session-management extension for Flask, which ships with no auth system of its own.
Learning Resources
No resources yet — check back soon.