parse_set_cookie(SetCookie :: binary())
-> {ok, Name, Value, Attrs} | ignore
Name :: binary()
Value :: binary()
Attrs :: cow_cookie:cookie_attrs()
cow_cookie:parse_set_cookie - Parse a set-cookie header
parse_set_cookie(SetCookie :: binary())
-> {ok, Name, Value, Attrs} | ignore
Name :: binary()
Value :: binary()
Attrs :: cow_cookie:cookie_attrs()
Parse a set-cookie header.
The set-cookie header value.
An ok tuple with the cookie name, value and attributes is returned on success.
An atom ignore is returned when the cookie has both an empty name and an empty value, or when the combined length of the name and value is greater than 4096 octets.
An expires or max_age more than 400 days in the future is reduced to 400 days. Dates are parsed with cow_date:parse_date/1.
case cow_cookie:parse_set_cookie(SetCookieHd) of
{ok, Name, Value, Attrs} ->
cookie_engine_set_cookie(Name, Value, Attrs);
ignore ->
do_nothing()
end.
cow_cookie(3), cow_cookie:parse_cookie(3), cow_cookie:cookie(3), cow_cookie:setcookie(3)
Support my work on Cowboy, Ranch, Gun and Erlang.mk via GitHub Sponsors. The funds cover domain names and development tools.