pub struct CookieSessionLayer { /* private fields */ }Expand description
Tower Layer that installs the session middleware into the request pipeline.
Construct with layer or CookieSessionService::layer rather than
directly. Apply before route handlers with Router::layer(session_layer).
The middleware reads the signed session cookie, loads the session from the database, validates the browser fingerprint (when configured), and inserts:
- an
Arc<SessionState>for thesuper::extractor::CookieSessionextractor - a
crate::auth::session::data::Sessionsnapshot for the data extractor
On the response path it flushes dirty session data, touches the expiry timestamp, and sets or clears the session cookie as needed.
Trait Implementations§
Source§impl Clone for CookieSessionLayer
impl Clone for CookieSessionLayer
Source§fn clone(&self) -> CookieSessionLayer
fn clone(&self) -> CookieSessionLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CookieSessionLayer
impl !RefUnwindSafe for CookieSessionLayer
impl Send for CookieSessionLayer
impl Sync for CookieSessionLayer
impl Unpin for CookieSessionLayer
impl UnsafeUnpin for CookieSessionLayer
impl !UnwindSafe for CookieSessionLayer
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