rocket-session-store is a library for the rocket web framework. It manages sessions by using cookies and a customizable store.
Using this library consists of two steps:
```rust norun use rocketsession_store::{ memory::MemoryStore, SessionStore, SessionResult, Session, CookieConfig, };
use rocket::{ Rocket, get, routes, launch, };
use std::time::Duration;
// Using the Session
request guard
async fn index(session: Session<'_, String>) -> SessionResult
fn rocket() -> _ {
// Instance a store that fits your needs and wrap it in a Box in SessionStore.
let memorystore: MemoryStore::
// Attach it to a rocket by calling `fairing()`
rocket::build().attach(store.fairing()).mount("/", routes![index])
}
```
If you wish to contribute, please read CONTRIBUTING.md.