aurelin-framework 0.3.0

Aurelin is a Rust translation of Laravel
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use tower_sessions::{
    Expiry, SessionManagerLayer, SessionStore,
    cookie::{SameSite, time::Duration},
};

pub fn web_session_layer<Store>(store: Store, cookie_name: &'static str, secure: bool) -> SessionManagerLayer<Store>
where
    Store: SessionStore,
{
    SessionManagerLayer::new(store)
        .with_name(cookie_name)
        .with_secure(secure)
        .with_same_site(SameSite::Lax)
        .with_expiry(Expiry::OnInactivity(Duration::minutes(120)))
}