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]
impl Session
pub fn new(cookie_name: String, secure: bool, http_only: bool) -> Session
[src]
pub fn new(cookie_name: String, secure: bool, http_only: bool) -> Session
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)
pub fn respect_dnt_ad_absurdum(&mut self)
[src]
pub fn respect_dnt_ad_absurdum(&mut self)
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]
impl<S, E> Plugin<S, E> for Session where
S: 'static,
E: 'static,
ⓘImportant traits for Box<R>fn handle(
&self,
data: PluginData<S>
) -> Box<Future<Item = PluginData<S>, Error = E>>
[src]
fn handle(
&self,
data: PluginData<S>
) -> Box<Future<Item = PluginData<S>, Error = E>>