tower-sessions-file-store

Crates.iotower-sessions-file-store
lib.rstower-sessions-file-store
version0.1.3
sourcesrc
created_at2024-11-03 10:49:41.04499
updated_at2024-11-30 06:49:34.919042
descriptionStore sessions for Tower Session store on the file system
homepage
repositoryhttps://github.com/mousetail/tower-sessions-file-store
max_upload_size
id1433571
size10,943
Maurits van Riezen (mousetail)

documentation

https://docs.rs/tower-sessions-file-store

README

Usage

let session_store = FileSessionStorage::new();
let session_layer = SessionManagerLayer::new(session_store)
    .with_expiry(Expiry::OnInactivity(Duration::secs(60 * 60)));
let deletion_task = tokio::task::spawn(
    session_store
        .clone()
        .continuously_delete_expired(tokio::time::Duration::from_secs(60 * 60)),
);

app.layer(session_layer);

Issues or pull requests welcome.

Commit count: 10

cargo fmt