1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 19:41:12 +00:00

Merge pull request #20 from ami44/master

set session name
This commit is contained in:
Nikolay Kim 2017-12-28 04:23:41 -08:00 committed by GitHub
commit 820404cdd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -401,6 +401,7 @@ impl<S> SessionBackend<S> 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<S: Into<String>>(mut self, value: S) -> CookieSessionBackendBuilder {
self.0.name = value.into();
self
}
/// Sets the `domain` field in the session cookie being built.
pub fn domain<S: Into<String>>(mut self, value: S) -> CookieSessionBackendBuilder {
self.0.domain = Some(value.into());