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.
Note that whatever you write into your session is visible by the user (but not modifiable).
Constructor panics if key length is less than 32 bytes.
Methods
impl RedisSessionBackend
[src]
pub fn new<S: Into<String>>(addr: S, key: &[u8]) -> RedisSessionBackend
[src]
Create new redis session backend
addr
- address of the redis server
pub fn ttl(self, ttl: u16) -> Self
[src]
Set time to live in seconds for session value
[src]
Set custom cookie name for session id
Trait Implementations
impl<S> SessionBackend<S> for RedisSessionBackend
[src]
type Session = RedisSession
type ReadFuture = Box<Future<Item = RedisSession, Error = Error>>
fn from_request(&self, req: &mut HttpRequest<S>) -> Self::ReadFuture
[src]
Parse the session from request and load data from a storage backend.