pub struct CookieSessionStore { /* private fields */ }Expand description
The default, stateless session store: the whole session is serialized into a
cookie value and signed with HMAC-SHA256 so it cannot be tampered with. The
cookie value is base64url(payload).base64url(signature).
(Spec 07 also calls for AES-256-GCM encryption on top of the signature; that is a follow-up — this signs but does not yet encrypt the payload.)
Implementations§
Trait Implementations§
Source§impl Default for CookieSessionStore
impl Default for CookieSessionStore
Source§fn default() -> Self
fn default() -> Self
A dev-only store with a fixed, insecure secret. Real apps must call
CookieSessionStore::new with a secret from config/credentials.
Source§impl SessionStore for CookieSessionStore
impl SessionStore for CookieSessionStore
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
raw: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
raw: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Decode a signed cookie value (the “id” argument carries the raw cookie).
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
_session: &'life1 Session,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
_session: &'life1 Session,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
No-op: a cookie session persists by having the response set its cookie
(via CookieSessionStore::encode); there is no server-side state.
fn destroy<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for CookieSessionStore
impl RefUnwindSafe for CookieSessionStore
impl Send for CookieSessionStore
impl Sync for CookieSessionStore
impl Unpin for CookieSessionStore
impl UnsafeUnpin for CookieSessionStore
impl UnwindSafe for CookieSessionStore
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more