General sessions module for web services
Async/await
Easy custom Storages
Stores the values in a Map<String, Value>
based on serdejson_
toml
sessions = { version = "0.2", features = ["memory"] }
```rust use std::sync::Arc; use sessions::*;
let config = Arc::new(Config { cookie: CookieOptions::new(), storage: MemoryStorage::new(), //storage: RedisStorage::new(RedisClient::open("redis://127.0.0.1")?), generate: Box::new(|| nano_id::base64(32)), verify: Box::new(|sid: &str| sid.len() == 32), });
let session = Session::new(&config.generate(), 0, config.clone());
session.set::
session.save().await; session.renew().await; session.destroy().await; ```
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.