session.rs
Rust test marker or harnessimports http::header
SHA-2562ea5ae558b6f829dfa67f0e6c1f2cf448349a6bd20f78abac980e23dd5d83fec
MaleculeMd₂(In₂Pa)
Evidence
1:16… ns.
2//!
3//! Actix provides a general solution for session management. The
4//! [**SessionStorage**](struct.SessionStorage.html)
5//! middleware can be used with different backend types to store session
6//! data in different backends.
7//!
8//! By default, …
15:19… ns more than 4000 bytes.
16//!
17//! A cookie may have a security policy of *signed* or *private*. Each has
18//! a respective `CookieSessionBackend` c …
23//! The constructors take a key as an argument. This is the private key
24//! for cookie session - when this value is changed, all session data is lo …
61:34… ent().stop();
62//! });
63//! }
64//! ```
65use std::cell::RefCell;
66use std::collections::HashMap;
67use std::marker::PhantomData;
68use std::rc::Rc;
69use std::sync::Arc;
70
71use cookie::{Cookie, CookieJar, Key, SameSite};
72use futures::future::{err as FutErr, ok as FutOk, FutureResult};
73use futures::Future;
74use http::header::{self, HeaderValue};
75use serde::de::DeserializeOwned;
76use serde::Serialize;
77use serde_json;
78use serde_json::error::Error as JsonError;
79use time::Duration;
80
81use error::{Error, ResponseError, Result};
82use handler::FromRequest;
83use httprequest::HttpRequest;
84use httpresponse::HttpResponse;
85use middleware::{Middleware, Response, Started};
86
87/// The helper trait to obtain your session data from a request.
88///
89/// ```rust
90/// use actix_web: …
⋯4 lines
572}
573
574#[cfg(test)]
575mod tests {
576 use super::*;
577 use application::App;
578 use test;
579
580 #[test]
581 fn cookie_session() {
582 let mut srv = test::TestServer::with_factory(|| {
583 App::new()
584 …