Create a cookie object.
cookie(
name,
value,
expires = NULL,
max_age = NULL,
domain = NULL,
path = NULL,
secure = TRUE,
http_only = TRUE,
same_site = NULL
)
Name of the cookie.
value of the cookie.
Expiry, if an integer assumes it's the number of seconds
from now. Otherwise accepts an object of class POSIXct
or Date
.
If a character
string then it is set as-is and not pre-processed.
If unspecified, the cookie becomes a session cookie. A session finishes
when the client shuts down, after which the session cookie is removed.
Indicates the number of seconds until the cookie expires.
A zero or negative number will expire the cookie immediately.
If both expires
and max_age
are set, the latter has precedence.
Defines the host to which the cookie will be sent. If omitted, this attribute defaults to the host of the current document URL, not including subdomains.
Indicates the path that must exist in the requested URL for the browser to send the Cookie header.
Indicates that the cookie is sent to the server only when a request is made with the https: scheme (except on localhost), and therefore, is more resistant to man-in-the-middle attacks.
Forbids JavaScript from accessing the cookie, for example, through the document.cookie property.
Controls whether or not a cookie is sent with cross-origin
requests, providing some protection against cross-site request forgery
attacks (CSRF). Accepts Strict
, Lax
, or None
.