pub struct SessionConfig {
pub expires_in: Duration,
pub update_age: Option<Duration>,
pub disable_session_refresh: bool,
pub fresh_age: Option<Duration>,
pub cookie_name: String,
pub cookie_secure: bool,
pub cookie_http_only: bool,
pub cookie_same_site: SameSite,
pub cookie_cache: Option<CookieCacheConfig>,
}Expand description
Session-specific configuration
Fields§
§expires_in: DurationSession expiration duration
update_age: Option<Duration>How often to refresh the session expiry (as a Duration).
When set, session expiry is only updated if the session is older than
this duration since the last update. When None, every request
refreshes the session (equivalent to the old update_age: true).
disable_session_refresh: boolIf true, sessions are never automatically refreshed on access.
fresh_age: Option<Duration>Session freshness window. A session younger than this is considered “fresh” (useful for step-up auth or sensitive operations).
Cookie name for session token
Cookie settings
Optional cookie-based session cache to avoid DB lookups.
When enabled, session data is cached in a signed/encrypted cookie.
SessionManager checks the cookie cache before hitting the database.
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