Attributes controlling how a browser stores and returns a cookie.
Every field is optional, and an omitted field emits no attribute rather than a default. Callers that want a secure cookie must say so: this codec applies no policy of its own, because the session plugin owns those defaults.
maxAge: number
Max-Age in seconds. 0 expires the cookie immediately (deletion).
path: string
Path scope. Conventionally '/' for an application-wide cookie.
domain: string
Domain scope. Omit for a host-only cookie, which is the safer default.
expires: Date
Expires as an absolute date, for clients predating Max-Age.
httpOnly: boolean
HttpOnly — hides the cookie from document.cookie.
secure: boolean
Secure — the cookie is only sent over HTTPS.
sameSite: "strict" | "lax" | "none"
SameSite policy. 'none' is invalid without Secure, so
serializeCookie emits Secure alongside it rather than
producing a cookie browsers discard.