pub struct SessionMiddleware { /* private fields */ }Expand description
Builder / configuration.
Implementations§
Source§impl SessionMiddleware
impl SessionMiddleware
Sourcepub fn new() -> SessionMiddleware
pub fn new() -> SessionMiddleware
Creates a new session middleware with sensible defaults.
Cookie name (default "tako_session").
Sourcepub fn ttl_secs(self, secs: u64) -> SessionMiddleware
pub fn ttl_secs(self, secs: u64) -> SessionMiddleware
Backwards-compatible idle TTL setter (sets idle_secs, leaves
absolute_secs at the default 24 h cap).
Sourcepub fn ttl(self, ttl: SessionTtl) -> SessionMiddleware
pub fn ttl(self, ttl: SessionTtl) -> SessionMiddleware
Sets the full TTL policy.
Sourcepub fn path(self, path: &str) -> SessionMiddleware
pub fn path(self, path: &str) -> SessionMiddleware
Cookie path (default "/").
Sourcepub fn domain(self, domain: &str) -> SessionMiddleware
pub fn domain(self, domain: &str) -> SessionMiddleware
Optional cookie Domain attribute.
Sourcepub fn secure(self, secure: bool) -> SessionMiddleware
pub fn secure(self, secure: bool) -> SessionMiddleware
Toggles the Secure flag.
Sourcepub fn http_only(self, on: bool) -> SessionMiddleware
pub fn http_only(self, on: bool) -> SessionMiddleware
Toggles the HttpOnly flag (default true).
Sourcepub fn same_site(self, ss: SameSite) -> SessionMiddleware
pub fn same_site(self, ss: SameSite) -> SessionMiddleware
Sets the SameSite attribute. Default: Lax. Note that None requires
Secure = true per all major browsers.
Sourcepub fn handle(&self) -> SessionStoreHandle
pub fn handle(&self) -> SessionStoreHandle
Returns a programmatic handle for revocation flows.
Trait Implementations§
Source§impl Default for SessionMiddleware
impl Default for SessionMiddleware
Source§fn default() -> SessionMiddleware
fn default() -> SessionMiddleware
Returns the “default value” for a type. Read more
Source§impl IntoMiddleware for SessionMiddleware
impl IntoMiddleware for SessionMiddleware
Auto Trait Implementations§
impl Freeze for SessionMiddleware
impl RefUnwindSafe for SessionMiddleware
impl Send for SessionMiddleware
impl Sync for SessionMiddleware
impl Unpin for SessionMiddleware
impl UnsafeUnpin for SessionMiddleware
impl UnwindSafe for SessionMiddleware
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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