Struct cookie::CookieJar [] [src]

pub struct CookieJar<'a> { /* fields omitted */ }

A jar of cookies for managing a session

Example

use cookie::{Cookie, CookieJar};

let c = CookieJar::new(b"f8f9eaf1ecdedff5e5b749c58115441e");

// Add a cookie to this jar
c.add(Cookie::new("key".to_string(), "value".to_string()));

// Remove the added cookie
c.remove("key");

Methods

impl<'a> CookieJar<'a>
[src]

Creates a new empty cookie jar with the given signing key.

The given key is used to sign cookies in the signed cookie jar.

Adds an original cookie from a request.

This method only works on the root cookie jar and is not intended for use during the lifetime of a request, it is intended to initialize a cookie jar from an incoming request.

Adds a new cookie to this cookie jar.

If this jar is a child cookie jar, this will walk up the chain of borrowed jars, modifying the cookie as it goes along.

Removes a cookie from this cookie jar.

Clears all cookies from this cookie jar.

Finds a cookie inside of this cookie jar.

The cookie is subject to modification by any of the child cookie jars that are currently borrowed. A copy of the cookie is returned.

Creates a child jar for permanent cookie storage.

All cookies written to the child jar will have an expiration date 20 years into the future to ensure they stick around for a long time.

Calculates the changes that have occurred to this cookie jar over time, returning a vector of Set-Cookie headers.

Return an iterator over the cookies in this jar.

This iterator will only yield valid cookies for this jar. For example if this is an encrypted child jar then only valid encrypted cookies will be yielded. If the root cookie jar is iterated over then all cookies will be yielded.

Trait Implementations

impl<'a> Debug for CookieJar<'a>
[src]

Formats the value using the given formatter.