#cookies #cookie-jar #jar

cookie_store

Implementation of Cookie storage and retrieval

28 releases (17 breaking)

new 0.22.1 Feb 16, 2026
0.22.0 Jul 20, 2025
0.21.1 Nov 9, 2024
0.21.0 Feb 8, 2024
0.5.1 Feb 22, 2019

#1 in #jar

Download history 474238/week @ 2025-10-28 539804/week @ 2025-11-04 464628/week @ 2025-11-11 490579/week @ 2025-11-18 356932/week @ 2025-11-25 560907/week @ 2025-12-02 530790/week @ 2025-12-09 499828/week @ 2025-12-16 223617/week @ 2025-12-23 240920/week @ 2025-12-30 493226/week @ 2026-01-06 586052/week @ 2026-01-13 591974/week @ 2026-01-20 587817/week @ 2026-01-27 650910/week @ 2026-02-03 769730/week @ 2026-02-10

2,664,346 downloads per month
Used in 2,017 crates (72 directly)

MIT/Apache

155KB
3.5K SLoC

Build Status Documentation

Provides an implementation for storing and retrieving Cookies per the path and domain matching rules specified in RFC6265.

Features

  • preserve_order - uses indexmap::IndexMap in lieu of HashMap internally, so cookies are maintained in insertion/creation order
  • public_suffix - Add support for public suffix lists, as provided by publicsuffix.
  • wasm-bindgen - Enables transitive feature time/wasm-bindgen; necessary in wasm contexts.
  • log_secure_cookie_values - Enable logging the values of cookies marked 'secure', off by default as values may be sensitive

Serialization

  • serde - Supports generic (format-agnostic) de/serialization for a CookieStore. Adds dependencies serde and serde_derive.
  • serde_json - Supports de/serialization for a CookieStore via the JSON format. Enables feature serde and adds depenency serde_json.
  • serde_ron - Supports de/serialization for a CookieStore via the RON format. Enables feature serde and adds depenency ron.

Usage with reqwest

Please refer to the reqwest_cookie_store crate, which now provides an implementation of the reqwest::cookie::CookieStore trait for cookie_store::CookieStore.

License

This project is licensed and distributed under the terms of both the MIT license and Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT

Dependencies

~4–6MB
~106K SLoC