CookieOptions
Configuration options for HTTP cookies in Buntal applications.
Source
Type Definition
type CookieOptions = {
maxAge?: number
expires?: Date
path?: string
domain?: string
secure?: boolean
httpOnly?: boolean
sameSite?: 'Strict' | 'Lax' | 'None'
}Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
maxAge | number | ❌ | - | Cookie lifetime in seconds. 0 expires the cookie immediately |
expires | Date | ❌ | - | Expiration date for the cookie |
path | string | ❌ | - | URL path where the cookie is valid. Not set unless given (delete defaults to /). Must not contain ; or spaces |
domain | string | ❌ | - | Domain where the cookie is valid. Must not contain ; or spaces |
secure | boolean | ❌ | false | Whether cookie should only be sent over HTTPS. Always added when sameSite is None |
httpOnly | boolean | ❌ | false | Whether cookie should be inaccessible to JavaScript |
sameSite | 'Strict' | 'Lax' | 'None' | ❌ | - | Controls cross-site request behavior. Not set unless given (browsers then treat it as Lax). Lax is recommended for sessions |
Last modified: 2026-10-02