Skip to main content

Module cookie

Module cookie 

Source
Expand description

RFC 6265 HTTP State Management Mechanism (Cookie Jar & Attributes).

Provides:

  • Full parsing of Set-Cookie headers with attributes: Expires, Max-Age, Domain, Path, Secure, HttpOnly, SameSite.
  • Pure-Rust HTTP date parser (RFC 1123, RFC 850, asctime) with leap-year handling.
  • RFC 6265 domain matching, path matching, and security domain boundaries.
  • Thread-safe, serializable CookieJar with automatic cookie injection into requests and response extraction.

Structs§

Cookie
An authentic RFC 6265 HTTP Cookie.
CookieJar
In-memory and persistent cookie storage conforming to RFC 6265.

Enums§

SameSite
Cookie SameSite policy attribute.

Functions§

can_set_cookie_domain
Checks whether an origin host is authorized to set a cookie for cookie_domain.
default_path_for_request
Computes the default path for a cookie given a request URI path per RFC 6265 §5.1.4.
domain_matches
Verifies whether request_host domain-matches cookie_domain per RFC 6265 §5.1.3.
parse_http_date
Parses an HTTP date string (RFC 1123, RFC 850, or asctime) into seconds since the UNIX epoch.
path_matches
Evaluates path matching between request path and cookie path per RFC 6265 §5.1.4.