@buntal/http/cookie

CookieOptions

Configuration options for HTTP cookies in Buntal applications.

Source

View source on GitHub

Type Definition

type CookieOptions = {
  maxAge?: number
  expires?: Date
  path?: string
  domain?: string
  secure?: boolean
  httpOnly?: boolean
  sameSite?: 'Strict' | 'Lax' | 'None'
}

Properties

PropertyTypeRequiredDefaultDescription
maxAgenumber❌-Cookie lifetime in seconds. 0 expires the cookie immediately
expiresDate❌-Expiration date for the cookie
pathstring❌-URL path where the cookie is valid. Not set unless given (delete defaults to /). Must not contain ; or spaces
domainstring❌-Domain where the cookie is valid. Must not contain ; or spaces
secureboolean❌falseWhether cookie should only be sent over HTTPS. Always added when sameSite is None
httpOnlyboolean❌falseWhether 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