1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-23 23:51:06 +01:00

Documentation update: RedisSessionBackend is renamed to RedisSession

This commit is contained in:
mait 2020-05-15 14:14:43 +03:00
parent 8bf33648ce
commit f3eaf5640c
2 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@
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,
constructor of `RedisSession`. 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).
@ -30,7 +30,7 @@ Constructor panics if key length is less than 32 bytes.
```rust
use actix_web::{App, HttpServer, web, middleware};
use actix_web::middleware::session::SessionStorage;
use actix_redis::RedisSessionBackend;
use actix_redis::RedisSession;
#[actix_rt::main]
async fn main() -> std::io::Result {
@ -39,7 +39,7 @@ async fn main() -> std::io::Result {
.middleware(middleware::Logger::default())
// cookie session middleware
.middleware(SessionStorage::new(
RedisSessionBackend::new("127.0.0.1:6379", &[0; 32])
RedisSession::new("127.0.0.1:6379", &[0; 32])
))
// register simple route, handle all methods
.service(web::resource("/").to(index))

View File

@ -20,7 +20,7 @@ use crate::redis::{Command, RedisActor};
/// 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
/// constructor of `RedisSession`. 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.