CookieJar.Cookie (cookie_jar v1.1.0) View Source

Model individual Cookie as specified by the MDN doc Some of the functionalities are irrelevant so only the following attributes are kept: domain, include_subdomain, path, secure, expires, name and value

Link to this section Summary

Functions

Return true if cookie2 is superceding cookie1. Only compare domain, path and name.

Return true if the cookie shall be sent to the uri

simple constructor

parse a cookie from the Set-Cookie: value. return nil if no valid cookie found

parse a cookie from the Set-Cookie: value. return nil if no valid cookie found taking additional infomatio ffrom the requesting URI

return name=value as string

Link to this section Types

Specs

t() :: %CookieJar.Cookie{
  domain: String.t(),
  expires: integer(),
  include_subdomain: boolean(),
  name: String.t(),
  path: String.t(),
  secure: boolean(),
  value: String.t()
}

Link to this section Functions

Link to this function

equal?(cookie1, cookie2)

View Source

Specs

equal?(t(), t()) :: boolean()

Return true if cookie2 is superceding cookie1. Only compare domain, path and name.

Specs

matched?(t(), URI.t()) :: boolean()

Return true if the cookie shall be sent to the uri

Specs

new(String.t(), String.t()) :: t()

simple constructor

Specs

parse(String.t()) :: nil | t()

parse a cookie from the Set-Cookie: value. return nil if no valid cookie found

Specs

parse(String.t(), nil | URI.t()) :: nil | t()

parse a cookie from the Set-Cookie: value. return nil if no valid cookie found taking additional infomatio ffrom the requesting URI

Specs

to_string(t()) :: String.t()

return name=value as string