Struct pemmican::plugins::session::Session[][src]

pub struct Session { /* fields omitted */ }

This plugin implements sessions. Sessions associate subsequent requests with earlier requests. Sessions are maintained automatically by always setting a cookie initially and finding it again on subsequent requests.

This plugin only manages the cookie and maintains PluginData.session_id. Associating data with that session_id is left up to the consumer of this library (hint: Store it in your shared state, the S type parameter on Pemmican, perhaps with a CHashMap)

Plug this in before main content handling plugins

Methods

impl Session
[src]

Create the Session plugin.

cookie_name is the name of the cookie (e.g. PHP uses PHP_SESS_ID)

secure is whether or not to allow transmission of the cookie over HTTP (without SSL)

http_only is whether or not to restrict the cookie to the HTTP protocol (or else allow javascript to access it)

If you set this, then clients setting the "DNT: 1" HTTP header will be unable to get sessions (using a cookie and checking it later is, strictly speaking, tracking).

Trait Implementations

impl<S, E> Plugin<S, E> for Session where
    S: 'static,
    E: 'static, 
[src]

Important traits for Box<R>

Auto Trait Implementations

impl Send for Session

impl Sync for Session