--- id: fastapi-sessions version: "0.3.2" license: MIT license_treatment: permissive maintenance: abandoned --- # fastapi-sessions — Ready-to-use session library for FastAPI License: permissive · Maintenance: abandoned · Downloads: 75.1K/mo ## What it is and what it does FastAPI-Sessions is a session authentication library for FastAPI that uses dependency injection to protect routes. It provides an abstract architecture for session backends (how sessions are stored) and frontends (how session IDs are extracted from requests), allowing you to mix and match implementations. The package ships with an in-memory backend and a signed-cookie frontend, and supports Pydantic models for session data validation. The library is designed to integrate cleanly with FastAPI's auto-generated documentation and dependency injection system. However, the project has been archived since July 2023 and is no longer maintained, meaning no updates, security patches, or support for newer FastAPI or Python versions are forthcoming. Use it for: - Add cookie-based session authentication to a FastAPI application without writing session middleware from scratch. - Protect individual routes with session verification using FastAPI's dependency injection system. - Build a custom session backend by extending the abstract backend interface to store sessions in a database or cache. - Validate session data using Pydantic models to ensure type safety and automatic OpenAPI documentation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds session authentication to FastAPI applications using dependency injection, with pluggable backends and frontends for storing and retrieving session data. No. The project is archived and abandoned since July 2023 with no maintenance or security updates. For new FastAPI projects, use actively maintained alternatives. For existing projects already using it, evaluate whether you can migrate to a maintained session library or implement session handling directly, as the lack of ongoing support poses a long-term risk. ## Install pip install fastapi-sessions uv add fastapi-sessions poetry add fastapi-sessions ## Installing fastapi-sessions Before you install: Installation is straightforward with only two runtime dependencies (fastapi and itsdangerous). However, the project is archived and abandoned as of July 2023, with no updates for over two years, so maintenance and security patches are no longer expected. License in practice: MIT license is permissive and places no restrictions on commercial or private use, modification, or distribution. Quickstart: pip install fastapi-sessions from fastapi import FastAPI, Depends from fastapi_sessions.backends.implementations import InMemoryBackend from fastapi_sessions.frontends.implementations import SessionCookie app = FastAPI() backend = InMemoryBackend() session_cookie = SessionCookie(secret_key="your-secret-key") @app.get("/") async def read_root(session_data=Depends(session_cookie)): return {"session": session_data} Requires Python 3.6.1 or later; project is archived and no longer maintained, so compatibility with recent FastAPI or Python versions is not guaranteed. Verify before relying: - Whether the in-memory backend is suitable for production use or multi-worker deployments. - Compatibility with FastAPI versions released after the last update in July 2023. - Whether custom backends and frontends are documented or straightforward to implement. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 75.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fastapi session authentication, session management fastapi, fastapi cookies sessions, dependency injection sessions, fastapi user sessions, session backend fastapi, signed cookie sessions, abandoned, session-auth [View on SkillFed](https://skillfed.io/packages/fastapi-sessions) · [View on PyPI](https://pypi.org/project/fastapi-sessions/)