Optional
domainSpecifies the value for the Domain
Set-Cookie
attribute.
When no domain is set clients consider the cookie to apply to the current domain only.
Optional
encodeSpecifies a function that will be used to encode a cookie-value.
Since value of a cookie has a limited character set (and must be a simple string), this function can be used to encode
a value into a string suited for a cookie's value, and should mirror decode
when parsing.
Optional
expiresSpecifies the Date
object to be the value for the Expires
Set-Cookie
attribute.
When no expiration is set clients consider this a "non-persistent cookie" and delete it the current session is over.
The cookie storage model specification states that if both expires
and
maxAge
are set, then maxAge
takes precedence, but it is possible not all clients by obey this,
so if both are set, they should point to the same date and time.
Optional
httpEnables the HttpOnly
Set-Cookie
attribute.
When enabled, clients will not allow client-side JavaScript to see the cookie in document.cookie
.
Optional
maxSpecifies the number
(in seconds) to be the value for the Max-Age
Set-Cookie
attribute.
The cookie storage model specification states that if both expires
and
maxAge
are set, then maxAge
takes precedence, but it is possible not all clients by obey this,
so if both are set, they should point to the same date and time.
Optional
partitionedEnables the Partitioned
Set-Cookie
attribute.
When enabled, clients will only send the cookie back when the current domain and top-level domain matches.
This is an attribute that has not yet been fully standardized, and may change in the future. This also means clients may ignore this attribute until they understand it. More information about can be found in the proposal.
Optional
pathSpecifies the value for the Path
Set-Cookie
attribute.
When no path is set, the path is considered the "default path".
Optional
prioritySpecifies the value for the Priority
Set-Cookie
attribute.
'low'
will set the Priority
attribute to Low
.'medium'
will set the Priority
attribute to Medium
, the default priority when not set.'high'
will set the Priority
attribute to High
.More information about priority levels can be found in the specification.
Optional
sameSpecifies the value for the SameSite
Set-Cookie
attribute.
true
will set the SameSite
attribute to Strict
for strict same site enforcement.'lax'
will set the SameSite
attribute to Lax
for lax same site enforcement.'none'
will set the SameSite
attribute to None
for an explicit cross-site cookie.'strict'
will set the SameSite
attribute to Strict
for strict same site enforcement.More information about enforcement levels can be found in the specification.
Optional
secureEnables the Secure
Set-Cookie
attribute.
When enabled, clients will only send the cookie back if the browser has a HTTPS connection.
Serialize options.