Skip to main content

split_cookies_string

Function split_cookies_string 

Source
pub fn split_cookies_string(cookies_string: &str) -> Vec<String>
Expand description

Split a combined Set-Cookie header string into individual cookie strings.

Some servers/proxies join multiple Set-Cookie field values with commas. This splits on those separators while leaving alone the commas inside a single value, such as the date in an Expires attribute.

assert_eq!(set_cookie_parser::split_cookies_string("a=1, b=2"), ["a=1", "b=2"]);