View Source CookieJar.Cookie (cookie_jar v1.1.0)

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 superseding 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

@type 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
@spec equal?(t(), t()) :: boolean()

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

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

Return true if the cookie shall be sent to the uri

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

simple constructor

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

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

@spec 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

@spec to_string(t()) :: String.t()

return name=value as string