Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • CookieSessionOptions

Index

Properties

Optional domain

domain: undefined | string

a string indicating the domain of the cookie (no default).

Optional expires

expires: Date

a Date object indicating the cookie's expiration date (expires at the end of session by default).

Optional httpOnly

httpOnly: undefined | false | true

a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (true by default).

Optional keys

keys: Array<string> | Keygrip

The list of keys to use to sign & verify cookie values. Set cookies are always signed with keys[0], while the other keys are valid for verification, allowing for key rotation.

Optional maxAge

maxAge: undefined | number

a number representing the milliseconds from Date.now() for expiry.

Optional name

name: undefined | string

The name of the cookie to set, defaults to session.

Optional overwrite

overwrite: undefined | false | true

a boolean indicating whether to overwrite previously set cookies of the same name (true by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.

Optional path

path: undefined | string

a string indicating the path of the cookie (/ by default).

Optional sameSite

sameSite: "strict" | "lax" | boolean

a boolean or string indicating whether the cookie is a "same site" cookie (false by default). This can be set to 'strict', 'lax', or true (which maps to 'strict').

Optional secret

secret: undefined | string

A string which will be used as single key if keys is not provided.

Optional secure

secure: undefined | false | true

a boolean indicating whether the cookie is only to be sent over HTTPS (false by default for HTTP, true by default for HTTPS).

Optional secureProxy

secureProxy: undefined | false | true

a boolean indicating whether the cookie is only to be sent over HTTPS (use this if you handle SSL not in your node process).

Optional signed

signed: undefined | false | true

a boolean indicating whether the cookie is to be signed (true by default). If this is true, another cookie of the same name with the .sig suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of cookie-name=cookie-value against the first Keygrip key. This signature key is used to detect tampering the next time a cookie is received.

Generated using TypeDoc