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:
parent
8bf33648ce
commit
f3eaf5640c
@ -20,7 +20,7 @@
|
|||||||
Use redis as session storage.
|
Use redis as session storage.
|
||||||
|
|
||||||
You need to pass an address of the redis server and random value to the
|
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.
|
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).
|
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
|
```rust
|
||||||
use actix_web::{App, HttpServer, web, middleware};
|
use actix_web::{App, HttpServer, web, middleware};
|
||||||
use actix_web::middleware::session::SessionStorage;
|
use actix_web::middleware::session::SessionStorage;
|
||||||
use actix_redis::RedisSessionBackend;
|
use actix_redis::RedisSession;
|
||||||
|
|
||||||
#[actix_rt::main]
|
#[actix_rt::main]
|
||||||
async fn main() -> std::io::Result {
|
async fn main() -> std::io::Result {
|
||||||
@ -39,7 +39,7 @@ async fn main() -> std::io::Result {
|
|||||||
.middleware(middleware::Logger::default())
|
.middleware(middleware::Logger::default())
|
||||||
// cookie session middleware
|
// cookie session middleware
|
||||||
.middleware(SessionStorage::new(
|
.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
|
// register simple route, handle all methods
|
||||||
.service(web::resource("/").to(index))
|
.service(web::resource("/").to(index))
|
||||||
|
@ -20,7 +20,7 @@ use crate::redis::{Command, RedisActor};
|
|||||||
/// Use redis as session storage.
|
/// Use redis as session storage.
|
||||||
///
|
///
|
||||||
/// You need to pass an address of the redis server and random value to the
|
/// 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.
|
/// session, When this value is changed, all session data is lost.
|
||||||
///
|
///
|
||||||
/// Constructor panics if key length is less than 32 bytes.
|
/// Constructor panics if key length is less than 32 bytes.
|
||||||
|
Loading…
Reference in New Issue
Block a user