opts() :: #{ max_cookies => non_neg_integer() | infinity, max_cookies_per_domain => non_neg_integer() | infinity }
gun_cookies_list - Cookie store backend: in-memory, per connection
The gun_cookies_list module implements a cookie store
backend that keeps all the cookie data in-memory and tied
to a specific connection.
It is possible to implement a custom backend on top of
gun_cookies_list in order to add persistence or sharing
properties. Note that it is the responsibility of the
custom backend to provide cookies that conform to RFC6265
if they come from external sources (e.g. files), especially
for the name, value, domain and path fields.
This module implements the callbacks defined in gun_cookies(3).
opts() :: #{ max_cookies => non_neg_integer() | infinity, max_cookies_per_domain => non_neg_integer() | infinity }
Cookie store backend options.
The default value is given next to the option name:
Maximum number of cookies kept in the store. When
the limit is reached, expired cookies are dropped
first, then cookies from the same registrable
domain as the cookie being stored, then cookies
with the earliest last-access-time. The value
infinity disables the limit.
Maximum number of cookies kept per registrable
domain (eTLD+1). Host-only cookies count toward
the same limit as Domain= cookies for that
site. When the limit is reached, expired cookies
are dropped first, then cookies from that site
with the earliest last-access-time. The value
infinity disables the limit.
2.6: The max_cookies and max_cookies_per_domain
options were added.
2.0: Module introduced.
{ok, ConnPid} = gun:open(Host, Port, #{
cookie_store => gun_cookies_list:init(#{})
})