Dynamo.HTTP.Cookies

Source

Functions summary

delete_cookie(conn, key, opts \\ [])

Deletes a cookie. The same options given when setting the cookie must be given on delete to ensure the browser will pick them up.

get_cookie(conn, key)

Returns the cookie value regardless if it was given sent on the request or set as part of the response.

get_cookies(conn)

Returns all cookies. In case you want to retrieve just a value, it is recommended to use get_cookie/2.

put_cookie(conn, key, value, opts \\ [])

Puts a cookie with given key and value and the given options to the connection.

Functions

delete_cookie(conn, key, opts \\ [])

Deletes a cookie. The same options given when setting the cookie must be given on delete to ensure the browser will pick them up.

Source

get_cookie(conn, key)

Returns the cookie value regardless if it was given sent on the request or set as part of the response.

Source

get_cookies(conn)

Returns all cookies. In case you want to retrieve just a value, it is recommended to use get_cookie/2.

Source

put_cookie(conn, key, value, opts \\ [])

Puts a cookie with given key and value and the given options to the connection.

Options

  • max_age - The cookie max-age in seconds. In order to support older IE versions, setting max_age also sets the Expires header;

  • secure - Marks the cookie as secure;

  • domain - The domain to which the cookie applies;

  • path - The path to which the cookie applies;

  • http_only - If the cookie is sent only via http. Default to true;

Source