Struct actix_redis::RedisSessionBackend [−][src]
pub struct RedisSessionBackend(_);
Use redis as session storage.
You need to pass an address of the redis server and random value to the
constructor of RedisSessionBackend
. This is private key for cookie
session, When this value is changed, all session data is lost.
Constructor panics if key length is less than 32 bytes.
Methods
impl RedisSessionBackend
[src]
impl RedisSessionBackend
pub fn new<S: Into<String>>(addr: S, key: &[u8]) -> RedisSessionBackend
[src]
pub fn new<S: Into<String>>(addr: S, key: &[u8]) -> RedisSessionBackend
Create new redis session backend
addr
- address of the redis server
pub fn ttl(self, ttl: u16) -> Self
[src]
pub fn ttl(self, ttl: u16) -> Self
Set time to live in seconds for session value
Set custom cookie name for session id
Set custom cookie path
Set custom cookie domain
Set custom cookie secure
If the secure
field is set, a cookie will only be transmitted when the
connection is secure - i.e. https
Set custom cookie max-age
Set custom cookie SameSite
Trait Implementations
impl<S> SessionBackend<S> for RedisSessionBackend
[src]
impl<S> SessionBackend<S> for RedisSessionBackend
type Session = RedisSession
type ReadFuture = Box<Future<Item = RedisSession, Error = Error>>
fn from_request(&self, req: &mut HttpRequest<S>) -> Self::ReadFuture
[src]
fn from_request(&self, req: &mut HttpRequest<S>) -> Self::ReadFuture
Parse the session from request and load data from a storage backend.
Auto Trait Implementations
impl !Send for RedisSessionBackend
impl !Send for RedisSessionBackend
impl !Sync for RedisSessionBackend
impl !Sync for RedisSessionBackend