pub struct Sessions { /* private fields */ }Expand description
Installs session handling. See the module docs.
Implementations§
Source§impl Sessions
impl Sessions
Sessions kept entirely in a signed cookie.
Sourcepub fn with_store<S: SessionStore>(store: S) -> Self
pub fn with_store<S: SessionStore>(store: S) -> Self
Sessions kept wherever store puts them.
Change the cookie name (default churust_session).
Sourcepub fn max_age(self, secs: i64) -> Self
pub fn max_age(self, secs: i64) -> Self
Expire the session after secs.
This sets Max-Age on the cookie and, for the built-in cookie store,
signs the deadline into the payload. Max-Age alone is only a hint to a
well-behaved client, so a copied cookie would otherwise stay valid
forever; the signed deadline is what actually stops replay.
A custom SessionStore owns its own expiry policy and is untouched.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Sessions
impl !UnwindSafe for Sessions
impl Freeze for Sessions
impl Send for Sessions
impl Sync for Sessions
impl Unpin for Sessions
impl UnsafeUnpin for Sessions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more