hound v1.0.2 Hound.Helpers.Cookie

Cookie-related functions

Summary

Functions

Gets cookies. Returns a list of ListDicts, each containing properties of the cookie

Delete a cookie with the given name

Delete all cookies

Sets cookie

Functions

cookies()

Specs

cookies :: list

Gets cookies. Returns a list of ListDicts, each containing properties of the cookie.

cookies()
delete_cookie(name)

Specs

delete_cookie(String.t) :: :ok

Delete a cookie with the given name

delete_cookies()

Specs

delete_cookies :: :ok

Delete all cookies

set_cookie(cookie)

Specs

set_cookie(map) :: :ok

Sets cookie.

set_cookie(%{name: "cart_id", value: 123213})
set_cookie(%{name: "cart_id", value: "23fa0ev5a6er", secure: true})

Accepts a Map with the following keys:

  • name (string) - REQUIRED
  • value (string) - REQUIRED
  • path (string)
  • domain (string)
  • secure (boolean)
  • expiry (integer, specified in seconds since midnight, January 1, 1970 UTC)