Registry / web-framework / tower-sessions

tower-sessions

JSON →
library0.15.0rscratesunverified

Sessions as a tower and axum middleware for web applications.

# Cargo.toml [dependencies] tower-sessions = "0.15.0"
INSTALL
IMPORT
SIG · TOWER-SESSIONS
T
tower-sessions
web-frameworkrustv0.15.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SessionManagerLayer
use tower_sessions::SessionManagerLayer;

Set up session middleware with axum and tower.

use axum::{Router, routing::get}; use tower_sessions::SessionManagerLayer; use tower_sessions::MemoryStore; async fn handler() -> &'static str { "Hello, session!" } #[tokio::main] async fn main() { let session_layer = SessionManagerLayer::new(MemoryStore::default()); let app = Router::new() .route("/", get(handler)) .layer(session_layer); println!("Server running"); }
Debug
Known issues
gotchaRequires an async runtime (e.g., tokio) for session storage backends.
fix
Add tokio as a dependency and use #[tokio::main].
affects: >=0.1.0
Upgrade
Version history
0.15.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
tower-sessions — cargo add tower-sessions · libregistry