These options are used in the HttpResponse.cookie method.

Hierarchy

  • CookieOptions

Properties

Optional domain

domain: undefined | string

Domain the cookie is set for.

Optional expires

expires: Date

Cookie expiration date (until when the cookie’s value is stored in the browser). This property’s value is set separately from maxAge.

Optional httpOnly

httpOnly: undefined | false | true

Cookies marked as HttpOnly are not available for the client JavaScript.

Optional maxAge

maxAge: undefined | number

Cookie max age.

Optional path

path: undefined | string

Relative path the cookie is set for.

Optional sameSite

sameSite: boolean | "lax" | "strict" | "none"
  • lax is the default value. It means that cookies will not be sent to other websites in most cases.
  • strict means that cookies will never be sent unless the user came from this website.
  • none means that cookies will be sent in any requests.

Optional secure

secure: undefined | false | true

Whether the cookie must be set only via a secure connection.