Plug v1.7.0 Plug.Conn.Cookies View Source

Conveniences for encoding and decoding cookies.

Link to this section Summary

Functions

Decodes the given cookies as given in a request header

Encodes the given cookies as expected in a response header

Link to this section Functions

Decodes the given cookies as given in a request header.

If a cookie is invalid, it is automatically discarded from the result.

Examples

iex> decode("key1=value1, key2=value2")
%{"key1" => "value1", "key2" => "value2"}
Link to this function encode(key, opts \\ %{}) View Source

Encodes the given cookies as expected in a response header.