Struct poem::session::CookieConfig
source · [−]pub struct CookieConfig { /* private fields */ }
Available on crate feature
session
only.Expand description
Cookie configuration for session.
Implementations
sourceimpl CookieConfig
impl CookieConfig
sourcepub fn path(self, value: impl Into<String>) -> Self
pub fn path(self, value: impl Into<String>) -> Self
Sets the Path
to the session cookie. Default is /
.
sourcepub fn secure(self, value: bool) -> Self
pub fn secure(self, value: bool) -> Self
Sets the Secure
to the session cookie. Default is true
.
sourcepub fn http_only(self, value: bool) -> Self
pub fn http_only(self, value: bool) -> Self
Sets the HttpOnly
to the session cookie. Default is true
.
sourcepub fn same_site(self, value: impl Into<Option<SameSite>>) -> Self
pub fn same_site(self, value: impl Into<Option<SameSite>>) -> Self
Sets the SameSite
to the session cookie.
sourcepub fn max_age(self, value: impl Into<Option<Duration>>) -> Self
pub fn max_age(self, value: impl Into<Option<Duration>>) -> Self
Sets the MaxAge
to the session cookie.
Set the cookie value to CookieJar
.
Remove the cookie from CookieJar
.
Gets the cookie value from CookieJar
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CookieConfig
impl Send for CookieConfig
impl Sync for CookieConfig
impl Unpin for CookieConfig
impl UnwindSafe for CookieConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more