pub struct SessionConfig {
pub lifetime: Duration,
pub cookie_name: String,
pub cookie_path: String,
pub cookie_secure: bool,
pub cookie_http_only: bool,
pub cookie_same_site: String,
pub table_name: String,
}Expand description
Session configuration
Fields§
§lifetime: DurationSession lifetime
Cookie name for the session ID
Cookie path
Whether to set Secure flag on cookie (HTTPS only)
Whether to set HttpOnly flag on cookie
SameSite attribute for the cookie
table_name: StringDatabase table name for sessions
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load session configuration from environment variables
Environment variables:
SESSION_LIFETIME: Session lifetime in minutes (default: 120)SESSION_COOKIE: Cookie name (default: ferro_session)SESSION_SECURE: Set Secure flag (default: true)SESSION_PATH: Cookie path (default: /)SESSION_SAME_SITE: SameSite attribute (default: Lax)
Set the cookie name
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
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 moreSource§impl Debug for SessionConfig
impl Debug for SessionConfig
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
impl UnwindSafe for SessionConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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