cookie
HTTP cookie parsing and cookie jar management. Supports signed and private (encrypted, authenticated) jars.
0.18.2
215M downloads/mo
#472 most downloaded on crates.io
SergioBenitez/cookie-rs
What this package is like to depend on
Last release 15 days ago
08 Aug 2026
Release timing varies
gaps range from 2 weeks to 2.4 years
Rarely documented
notes for 17 of 76 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
78 releases · first in 2014
1 release in the last 12 months
see the full history below
Release timeline
78 releases · Nov 2014 to Aug 2026Releases
latest 60 of 78-
0.18.208 Aug 2026Release notes
Open source →Changes and Fixes
-
Stopped using internal
timeAPIs. -
Expiresparsing is more RFC 6265-compliant.- Weekday prefixes are now optional.
- Two-digit years follow the RFC boundary:
69is2069(not1969).
-
The manifest now declares
rust-version = "1.56".
-
-
0.18.125 Mar 2024Release notes
Open source →New Features
-
Added support for the draft
Partitionedattribute.The new
CookieBuilder::partition(),Cookie::partitioned(), andCookie::set_partitioned()methods allow enabling and/or disabling the attribute. Additionally, the attribute is recognized during parsing. -
Added
CookieBuilder::removal(), counterpart toCookie::make_removal().
-
-
0.18.009 Oct 2023Release notes
Open source →Breaking Changes
-
The MSRV is now 1.56.
-
Cookie::value()no longer trims surrounding double quotes. (89eddd)Use
Cookie::value_trimmed()for the previous behavior. -
Many methods now expect a
T: Into<Cookie>in place ofCookie. (49ff7b)Functions and methods that previously accepted a
Cookienow accept anyT: Into<Cookie>. This particularly affects theCookieJarAPI, which now allows simpler addition and removal of cookies:jar.add(("foo", "bar"));jar.add(Cookie::build(("foo", "bar")).path("/"));jar.remove("foo");jar.remove(Cookie::build("foo").path("/"));
-
CookieJar::force_remove()now expects aT: AsRef<str>in place of&Cookie.Force-removal never requires more information than a cookie's name. The API has been simplified to reflect this.
-
CookieBuilder::finish()was deprecated in favor ofCookieBuilder::build().This largely serves as a compile-time notice that calling
finish()orbuild()is largely unnecessary given thatCookieBuilderimplementsInto<Cookie>. -
Cookie::named()was deprecated in favor of usingCookie::build()orCookie::from().Cookie::named("foo")is equivalent toCookie::from("foo").Cookie::build("foo")begins building a cookie equivalent toCookie::named("foo").
New Features
-
Added
Cookie::value_trimmed()andCookie::name_value_trimmed().These versions of
Cookie::value()andCookie::name_value(), respectively, trim a matching pair of surrounding double quotes from the cookie's value, if any are present. -
String-like types, tuples of string-like types, and
CookieBuilderimplementInto<Cookie>.Implementations of
Into<Cookie>for string-like types (&str,String,Cow<str>), tuples of string-like types(name: string, value: string), andCookieBuilderwere added. The former implementations create a cookie with a name corresponding to the string and an empty value. The tuple implementation creates a cookie with the given name and value strings. TheCookieBuilderimplementation returns the built cookie. -
KeyimplementsDebug.To not leak sensitive information, the representation is simply
"Key". -
CookieBuilderimplementsBorrow{Mut}<Cookie>,As{Ref,Mut}<Cookie>,Display. -
Added
CookieBuilder::inner{_mut}()to (mutably) borrow cookies being built. -
Added
PrefixedJarandCookieJar::prefixed{_mut}(), which implement the cookie prefixes HTTP draft.
-
-
0.18.0-rc.027 Sep 2023 pre-releaseNothing published for this version
-
0.17.023 Jan 2023Release notes
Open source →Breaking Changes
-
Cookie parsing no longer removes a
.Domainprefix.Cookie::domain()now removes a.prefix before returning.As these changes are inverses, they are not likely observable. The change only affects manually set
domainvalues via the.domain()builder method, theset_domain()setter method, or similar, which will now have a prefix of.removed when returned byCookie::domain(). This results in more consistent treatment ofDomainvalues.
New Features
-
Added
Cookie::split_parse()andCookie::split_parse_encoded()methods.The methods split a
;-joined cookie string and parse/decode the split values. They return a newly introduced iterator value of typeSplitCookiesover the parse results.
General Changes and Fixes
- Parsing fuzzers were introduced and run for 48 CPU hours without failure.
base64was updated to0.21.
Version 0.16
-
-
0.16.216 Dec 2022 -
0.16.126 Sep 2022Release notes
Open source →Changes and Fixes
- The
,,(, and)are percent-encoded/decoded when encoding is used. - The
aes-gcmdependency was updated to 0.10.
- The
-
0.16.029 Dec 2021Release notes
Open source →Breaking Changes
- The MSRV is now
1.53, up from1.41in0.15. timehas been updated to0.3and is reexported from the crate root.
General Changes
rust-cryptodependencies were updated to their latest versions.
Version 0.15
- The MSRV is now
-
0.16.0-rc.119 Aug 2021 pre-release -
0.15.226 Sep 2022Nothing published for this version
-
0.15.114 Jul 2021Release notes
Open source →Changes and Fixes
- A panic that could result from non-char boundary indexing was fixed.
- Stale doc references to version
0.14were updated.
-
0.15.025 Feb 2021Release notes
Open source →Breaking Changes
Cookie::force_remove()takes&Cookieinstead ofCookie.- Child jar methods split into immutable and mutable versions
(
Cookie::{private{_mut}, signed{_mut}}). Cookie::encoded()returns a newDisplaystruct.- Dates with year
<= 99are handled like Chrome: range0..=68maps to2000..=2068,69..=99to1969..=1999. Cookie::{set_}expires()operates on a newExpirationenum.
New Features
- Added
Cookie::make_removal()to manually create expired cookies. - Added
Cookie::stripped()display variant to print only thenameandvalueof a cookie. Keyimplements a constant-timePartialEq.- Added
Key::master()to retrieve the full 512-bit master key. - Added
PrivateJar::decrypt()to manually decrypt an encryptedCookie. - Added
SignedJar::verify()to manually verify a signedCookie. Cookie::expires()returns anOption<Expiration>to allow distinguishing between unset andNoneexpirations.- Added
Cookie::expires_datetime()to retrieve the expiration as anOffsetDateTime. - Added
Cookie::unset_expires()to unset expirations.
General Changes and Fixes
- MSRV is 1.41.
Version 0.14
-
0.14.402 Mar 2021Nothing published for this version
-
0.14.306 Nov 2020Release notes
Open source →Changes and Fixes
rust-cryptodependencies were updated to their latest versions.
-
0.14.222 Jul 2020Release notes
Open source →Changes and Fixes
- Documentation now builds on the stable channel.
rust-cryptodependencies were updated to their latest versions.- Fixed 'interator' -> 'iterator' documentation typo.
-
0.14.105 Jun 2020Release notes
Open source →Changes and Fixes
- Updated
base64dependency to 0.12. - Updated minimum
timedependency to correct version: 0.2.11. - Added
readmekey toCargo.toml, updatedlicensefield.
- Updated
-
0.14.029 May 2020Release notes
Open source →Breaking Changes
- The
Key::from_master()method was deprecated in favor of the more aptly namedKey::derive_from(). - The deprecated
CookieJar::clear()method was removed.
New Features
- Added
Key::from()to create aKeystructure from a full-length key. - Signed and private cookie jars can be individually enabled via the new
signedandprivatefeatures, respectively. - Key derivation via key expansion can be individually enabled via the new
key-expansionfeature.
General Changes and Fixes
ringis no longer a dependency:RustCrypto-based cryptography is used in lieu ofring. Prior to their inclusion here, thehmacandhkdfcrates were audited.- Quotes, if present, are stripped from cookie values when parsing.
Version 0.13
- The
-
0.13.303 Feb 2020Release notes
Open source →Changes
- The
timedependency was unpinned from0.2.4, allowing any0.2.xversion oftimewherex >= 6.
- The
-
0.13.228 Jan 2020Release notes
Open source →Changes
- The
timedependency was pinned to0.2.4due to upstream breaking changes in0.2.5.
- The
-
0.13.124 Jan 2020Release notes
Open source →New Features
- Added the
CookieJar::reset_delta()method, which reverts all delta changes to aCookieJar.
- Added the
-
0.13.021 Jan 2020Release notes
Open source →Breaking Changes
timewas updated from 0.1 to 0.2.ringwas updated from 0.14 to 0.16.SameSite::Nonenow writesSameSite=Noneto correspond with updatedSameSitedraft.SameSitecan be unset by passingNonetoCookie::set_same_site().CookieBuildergained a lifetime:CookieBuilder<'c>.
General Changes and Fixes
- Added a CHANGELOG.
expires,max_age,path, anddomaincan be unset by passingNoneto the respectiveCookie::set_{field}()method.- The "Expires" field is limited to a date-time of Dec 31, 9999, 23:59:59.
- The
%character is now properly encoded and decoded. - Constructor methods on
CookieBuilderallow non-static lifetimes.
-
0.12.002 May 2019Nothing published for this version
-
0.11.526 Sep 2022Nothing published for this version
-
0.11.402 Mar 2021Nothing published for this version
-
0.11.329 May 2020Nothing published for this version
-
0.11.228 Jan 2020Nothing published for this version
-
0.11.102 May 2019Nothing published for this version
-
0.11.025 Jul 2018Nothing published for this version
-
0.10.110 Oct 2017Nothing published for this version
-
0.10.031 Aug 2017Nothing published for this version
-
0.9.210 Oct 2017Nothing published for this version
-
0.9.117 Jun 2017Nothing published for this version
-
0.9.015 Jun 2017Nothing published for this version
-
0.8.109 May 2017Nothing published for this version
-
0.8.009 May 2017Nothing published for this version
-
0.7.607 May 2017Nothing published for this version
-
0.7.519 Apr 2017Nothing published for this version
-
0.7.411 Apr 2017Nothing published for this version
-
0.7.320 Mar 2017Nothing published for this version
-
0.7.208 Mar 2017Nothing published for this version
-
0.7.002 Mar 2017Nothing published for this version
-
0.6.207 May 2017Nothing published for this version
-
0.6.128 Feb 2017Nothing published for this version
-
0.6.026 Jan 2017Nothing published for this version
-
0.5.129 Dec 2016Nothing published for this version
-
0.5.029 Dec 2016Nothing published for this version
-
0.4.021 Nov 2016Nothing published for this version
-
0.3.113 Oct 2016Nothing published for this version
-
0.3.001 Aug 2016Nothing published for this version
-
0.2.509 Jun 2016Nothing published for this version
-
0.2.425 Apr 2016Nothing published for this version
-
0.2.321 Apr 2016Nothing published for this version
-
0.2.226 Nov 2015Nothing published for this version
-
0.2.118 Nov 2015Nothing published for this version
-
0.2.011 Aug 2015Nothing published for this version
-
0.1.2101 Jun 2015Nothing published for this version
-
0.1.2028 Apr 2015Nothing published for this version
-
0.1.1922 Apr 2015Nothing published for this version
-
0.1.1806 Apr 2015Nothing published for this version
-
0.1.1702 Apr 2015Nothing published for this version