parse_cookie_header_value

Function parse_cookie_header_value 

Source
pub fn parse_cookie_header_value(
    header: &[u8],
) -> impl Iterator<Item = (&str, &[u8])>
Expand description

Build an iterator from the value part of a Cookie: header that will yield a name/value tuple for each cookie.

Certain characters are not permitted in cookie names, and different characters are not permitted in cookie values. See RFC6265 for details. This function makes no attempt to validate the name or value of the cookie headers.

Cookie values may or may not be quoted. (Like this: session=“38h29onuf20138t”) This iterator will never include the quotes in the emitted value. In the above example, the pair will be: (“session”, “38h29onuf20138t”) instead of (“session”, “"38h29onuf20138t"”) Note that according to RFC6265, using quotes is optional and never necessary because the characters permitted inside a quoted value are the exact same characters permitted outside the quoted value.

Cookie values may not necessarily be valid UTF-8. As such, this function emits values of type &[u8].