Skip to main content

CookieOptions

Attributes applied when writing a cookie. The low-level shape, all optional.

Properties​

PropertyTypeDescription
domain?stringCookie domain.
expires?DateAbsolute expiry.
httpOnly?booleanWhether to hide the cookie from client JS.
maxAge?numberMax age in seconds.
path?stringCookie path. Defaults to "/".
sameSite?"none" | "lax" | "strict"CSRF posture. Defaults to "lax".
secure?booleanWhether to send only over HTTPS.