Crates.io | sessions |
lib.rs | sessions |
version | 0.6.0 |
source | src |
created_at | 2019-12-17 04:28:46.455886 |
updated_at | 2024-01-02 08:10:40.509396 |
description | General sessions module for web services |
homepage | https://github.com/viz-rs/sessions |
repository | https://github.com/viz-rs/sessions |
max_upload_size | |
id | 189929 |
size | 9,942 |
General sessions module for web services
Async/await
Easy custom Storages
Stores the values in a BTreeMap<String, Value>
sessions = { version = "0.4", features = ["memory"] }
use std::sync::Arc;
use sessions::*;
let config = Arc::new(Store::new(
MemoryStorage::new(),
nano_id::base64::<32>,
|sid: &str| sid.len() == 32,
));
let session = Session::new(Data::new());
session.set::<String>("crate", "sessions".to_string());
let val: Option<String> = session.get("crate");
session.remove("crate");
session.clear();