cow_cookie:cookie(3)

NAME

cow_cookie:cookie - Generate a cookie header

DESCRIPTION
    cookie(Cookies) -> iolist()

    Cookies :: [{Name :: iodata(), Value :: iodata()}]

Generate a cookie header.

Note that this function expects the Name and Value to be safe, meaning they do not contain invalid characters according to RFC6265 section 4.2.1.

ARGUMENTS

Cookies
    A list of pairs of cookie name and value.

RETURN VALUE

An iolist with the generated cookie header value.

CHANGELOG
    • 2.9: Function introduced.

EXAMPLES

Generate a cookie header
    Cookie = cow_cookie:cookie([{<<"sessionid">>, ID}]).

SEE ALSO

cow_cookie(3), cow_cookie:parse_cookie(3), cow_cookie:parse_set_cookie(3), cow_cookie:setcookie(3)