Flask-Login

Flask-Login

Open Source

User session management for Flask apps.

Authentication

Published 27 September 2026

Part ofFlask Flask

Scores

Popularity
0/5
Learning Curve
0/5
Flexibility
0/5
Performance
0/5
Portability
0/5

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 Source

Tech Stacks with Flask-Login

HTMX + Flask

Project

The 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.

Frontend

Backend

Programming

Databases

Hosting

Database:
Deploy on:
Authentication add-on:
CI/CD add-on:
Containerization add-on:
Email add-on:
Payments add-on:
Styling add-on:
Interactivity add-on:
Analytics add-on:

Flask + HTML Templates

Project

Minimal Flask app serving Jinja2 HTML templates, great for small projects and prototypes.

Database:
Deploy on:
Authentication add-on:
CI/CD add-on:
Containerization add-on:
Email add-on:
Payments add-on:
Styling add-on:
Analytics add-on:

Replit + Flask

Project

Build 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.

Authentication add-on:
CI/CD add-on:
Containerization add-on:
Email add-on:
Payments add-on:
Styling add-on:
Analytics add-on:

Tools Related to Flask-Login

Learning Resources

No resources yet — check back soon.

Tags

Open SourceSelf-hostableAuthentication

Details

Maintained
Yes
Primary language
Python
Domain
Auth
GitHub stars
3.7k
Stars updated
2026-09-23