1 unstable release
| 0.12.0 | Apr 11, 2019 |
|---|
#4 in #percent-encode
Used in 2 crates
(via vial)
105KB
1.5K
SLoC
cookie2
A fork of cookie with just updated dependencies.
lib.rs:
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.
Usage
Add the following to the [dependencies] section of your Cargo.toml:
cookie2 = "0.12"
Features
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
CookieJarandSignedJarandPrivateJarstructures 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_encodedmethods ofCookiebecome available. Theencodedmethod returns a wrapper around aCookiewhoseDisplayimplementation percent-encodes the name and value of the cookie. Theparse_encodedmethod percent-decodes the name and value of aCookieduring parsing. When this feature is disabled, theencodedandparse_encodedmethods are not available.
You can enable features via the Cargo.toml file:
[dependencies.cookie]
features = ["secure", "percent-encode"]
Dependencies
~0.7–2.7MB
~72K SLoC