Cookie interface
Http response cookie object to "Set-Cookie"
Properties
domain | Specifies allowed hosts to receive the cookie |
expires | NOTE: It is generally recommended that you use maxAge over expires. Sets the cookie to expire at a specific date instead of when the client closes. This can be a Javascript Date or Unix time in milliseconds. |
http |
Sets the cookie to be inaccessible to JavaScript's Document.cookie API |
max |
Number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately. |
name | |
path | Specifies URL path that must exist in the requested URL |
same |
Can restrict the cookie to not be sent with cross-site requests |
secure | Sets the cookie to only be sent with an encrypted request |
value |
Property Details
domain
Specifies allowed hosts to receive the cookie
domain?: string
Property Value
string
expires
NOTE: It is generally recommended that you use maxAge over expires. Sets the cookie to expire at a specific date instead of when the client closes. This can be a Javascript Date or Unix time in milliseconds.
expires?: number | Date
Property Value
number | Date
httpOnly
Sets the cookie to be inaccessible to JavaScript's Document.cookie API
httpOnly?: boolean
Property Value
boolean
maxAge
Number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately.
maxAge?: number
Property Value
number
name
name: string
Property Value
string
path
Specifies URL path that must exist in the requested URL
path?: string
Property Value
string
sameSite
Can restrict the cookie to not be sent with cross-site requests
sameSite?: "Strict" | "Lax" | "None"
Property Value
"Strict" | "Lax" | "None"
secure
Sets the cookie to only be sent with an encrypted request
secure?: boolean
Property Value
boolean
value
value: string
Property Value
string