pub struct Cookie {
pub name: String,
pub value: String,
pub expires: Option<String>,
pub max_age: Option<i64>,
pub domain: Option<String>,
pub path: Option<String>,
pub secure: bool,
pub http_only: bool,
pub same_site: Option<String>,
pub partitioned: bool,
pub other: Vec<(String, String)>,
}Expand description
A parsed cookie from a Set-Cookie header.
name and value come from the first name=value pair; the remaining fields are
the cookie’s attributes (present only when set). expires is kept as the raw
header value (parse it with a date crate if you need a timestamp). Attributes other
than the well-known ones are collected, in order, into other.
Fields§
§name: StringThe cookie name (may be empty for a bare value with no =).
value: StringThe cookie value (URI-decoded unless decoding is disabled).
expires: Option<String>The raw Expires attribute value, if present.
max_age: Option<i64>The Max-Age attribute, parsed as an integer (à la JS parseInt).
domain: Option<String>The Domain attribute.
path: Option<String>The Path attribute.
secure: boolWhether the Secure attribute is present.
http_only: boolWhether the HttpOnly attribute is present.
same_site: Option<String>The SameSite attribute value (e.g. Lax, Strict, None).
partitioned: boolWhether the Partitioned attribute is present.
other: Vec<(String, String)>Any other attributes, as (lower-cased key, value) pairs, in order.