Crate async_redis_session_v2
source ·Expand description
async-redis-session
use async_redis_session::RedisSessionStore;
use async_session::{Session, SessionStore};
let store = RedisSessionStore::new("redis://127.0.0.1/")?;
let mut session = Session::new();
session.insert("key", "value")?;
let cookie_value = store.store_session(session).await?.unwrap();
let session = store.load_session(cookie_value).await?.unwrap();
assert_eq!(&session.get::<String>("key").unwrap(), "value");
Structs
- RedisSessionStore