Struct actix_web::middleware::CookieSessionBackend [] [src]

pub struct CookieSessionBackend(_);

Use signed cookies as session storage.

CookieSessionBackend creates sessions which are limited to storing fewer than 4000 bytes of data (as the payload must fit into a single cookie). Internal server error get generated if session contains more than 4000 bytes.

You need to pass a random value to the constructor of CookieSessionBackend. 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 CookieSessionBackend
[src]

[src]

Construct new CookieSessionBackend instance.

Panics if key length is less than 32 bytes.

[src]

Creates a new CookieSessionBackendBuilder instance from the given key.

Panics if key length is less than 32 bytes.

Example

use actix_web::middleware::CookieSessionBackend;

let backend = CookieSessionBackend::build(&[0; 32]).finish();