HTTP cookie parsing and cookie jar management.
This crates provides the
Cookie type, which directly
maps to an HTTP cookie, and the
which allows for simple management of many cookies as well as encryption and
signing of cookies for session management.
Add the following to the
[dependencies] section of your
cookie = "0.11"
Then add the following line to your crate root:
extern crate cookie;
This crates can be configured at compile-time through the following Cargo features:
secure (disabled by default)
Enables signed and private (signed + encrypted) cookie jars.
When this feature is enabled, the signed and private method of
PrivateJarstructures are available. The jars act as "children jars", allowing for easy retrieval and addition of signed and/or encrypted cookies to a cookie jar. When this feature is disabled, none of the types are available.
percent-encode (disabled by default)
Enables percent encoding and decoding of names and values in cookies.
When this feature is enabled, the encoded and
Cookiebecome available. The
encodedmethod returns a wrapper around a
Displayimplementation percent-encodes the name and value of the cookie. The
parse_encodedmethod percent-decodes the name and value of a
Cookieduring parsing. When this feature is disabled, the
parse_encodedmethods are not available.
You can enable features via the
[dependencies.cookie] features = ["secure", "percent-encode"]
Representation of an HTTP cookie.
Structure that follows the builder pattern for building
A collection of cookies that tracks its modifications.
Iterator over the changes to a cookie jar.
Iterator over all of the cookies in a jar.
A cryptographic master key for use with
A child cookie jar that provides authenticated encryption for its cookies.
A child cookie jar that authenticates its cookies.
Enum corresponding to a parsing error.