Crates.io | tower-sessions-file-store |
lib.rs | tower-sessions-file-store |
version | 0.1.3 |
source | src |
created_at | 2024-11-03 10:49:41.04499 |
updated_at | 2024-11-30 06:49:34.919042 |
description | Store sessions for Tower Session store on the file system |
homepage | |
repository | https://github.com/mousetail/tower-sessions-file-store |
max_upload_size | |
id | 1433571 |
size | 10,943 |
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.