1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-27 12:01:15 +00:00

update guide example

This commit is contained in:
Nikolay Kim 2017-12-19 18:38:02 -08:00
parent 50b2f62c80
commit d0c01c2cdd

View file

@ -115,7 +115,7 @@ session data.
# extern crate actix;
# extern crate actix_web;
use actix_web::*;
use actix_web::middlewares::RequestSession;
use actix_web::middlewares::{RequestSession, SessionStorage, CookieSessionBackend};
fn index(mut req: HttpRequest) -> Result<&'static str> {
// access session data
@ -133,8 +133,8 @@ fn main() {
# let sys = actix::System::new("basic-example");
HttpServer::new(
|| Application::new()
.middleware(middlewares::SessionStorage::new( // <- create session middlewares
middlewares::CookieSessionBackend::build(&[0; 32]) // <- create cookie session backend
.middleware(SessionStorage::new( // <- create session middlewares
CookieSessionBackend::build(&[0; 32]) // <- create cookie session backend
.secure(false)
.finish()
)))