From 27b0dfd761d501d0bee14c9d04835eb8404dd4a5 Mon Sep 17 00:00:00 2001 From: Alban Minassian Date: Thu, 28 Dec 2017 13:02:46 +0100 Subject: [PATCH] set sessio name --- src/middleware/session.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/middleware/session.rs b/src/middleware/session.rs index 8ac068888..a03077c26 100644 --- a/src/middleware/session.rs +++ b/src/middleware/session.rs @@ -401,6 +401,7 @@ impl SessionBackend for CookieSessionBackend { /// # fn main() { /// let backend: CookieSessionBackend = CookieSessionBackend::build(&[0; 32]) /// .domain("www.rust-lang.org") +/// .name("actix_session") /// .path("/") /// .secure(true) /// .finish(); @@ -420,6 +421,12 @@ impl CookieSessionBackendBuilder { self } + /// Sets the `name` field in the session cookie being built. + pub fn name>(mut self, value: S) -> CookieSessionBackendBuilder { + self.0.name = value.into(); + self + } + /// Sets the `domain` field in the session cookie being built. pub fn domain>(mut self, value: S) -> CookieSessionBackendBuilder { self.0.domain = Some(value.into());