Expand description
Storage implementations for sessions
This module provides various storage backends for session data, with optional support for session indexing by identifier.
§Session Indexing
Some storage backends support indexing sessions by an identifier (like user ID). This enables advanced features such as:
- Finding all active sessions for a user
- Bulk invalidation of sessions (e.g., “log out everywhere”)
- Security auditing and monitoring
To use indexing, your session type must implement crate::SessionIdentifier.
§Custom Storage
Implement SessionStorage to create custom storage backends. For indexing
support, also implement SessionStorageIndexed.
Modules§
- cookie
cookie - Cookie-based session storage implementation
- memory
- In-memory session storage implementation
- redis
redis_fred - Session storage with Redis (and Redis-compatible databases)
- sqlx
sqlx_postgresorsqlx_sqlite - Session storage via sqlx
Traits§
- Session
Storage - Trait representing a session backend storage. You can use your own session storage by implementing this trait.
- Session
Storage Indexed - Extended trait for storage backends that support session indexing by identifier. This allows operations like finding all sessions for a user or bulk invalidation.