#let #parser #cookie #delta #jar #key #count #remove #parse


Crate for parsing HTTP cookie headers and managing a cookie jar. Supports signed and private (encrypted + signed) jars.

1 unstable release

0.12.0 Apr 11, 2019
Download history 15/week @ 2023-07-18 20/week @ 2023-07-25 9/week @ 2023-08-01 13/week @ 2023-08-08 15/week @ 2023-08-15 7/week @ 2023-08-22 12/week @ 2023-08-29 20/week @ 2023-09-05 10/week @ 2023-09-12 7/week @ 2023-09-19 12/week @ 2023-09-26 10/week @ 2023-10-03 10/week @ 2023-10-10 12/week @ 2023-10-17 15/week @ 2023-10-24 14/week @ 2023-10-31

53 downloads per month
Used in 2 crates (via vial)


1.5K SLoC


Build Status Current Crates.io Version

A fork of cookie with just updated dependencies.


HTTP cookie parsing and cookie jar management.

This crates provides the Cookie type, which directly maps to an HTTP cookie, and the CookieJar type, 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 Cargo.toml:

cookie2 = "0.12"


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 CookieJar and SignedJar and PrivateJar structures 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 parse_encoded methods of Cookie become available. The encoded method returns a wrapper around a Cookie whose Display implementation percent-encodes the name and value of the cookie. The parse_encoded method percent-decodes the name and value of a Cookie during parsing. When this feature is disabled, the encoded and parse_encoded methods are not available.

You can enable features via the Cargo.toml file:

features = ["secure", "percent-encode"]


~71K SLoC