Skip to content

Latest commit

 

History

History
152 lines (67 loc) · 1.99 KB

next-context.cookieattributes.md

File metadata and controls

152 lines (67 loc) · 1.99 KB

Home > next-context > CookieAttributes

CookieAttributes interface

cookie attributes

Signature:

export interface CookieAttributes 

Properties

Property

Modifiers

Type

Description

domain?

string | undefined

(Optional) Define the domain where the cookie is available. Defaults to the domain of the page where the cookie was created.

expires?

Date | undefined

(Optional) Defines the exact date when the cookie will expire.

maxAge?

number

(Optional) Sets the cookie’s lifespan in seconds.

path?

string | undefined

(Optional) Define the path where the cookie is available. Defaults to '/'

sameSite?

'strict' | 'lax' | 'none' | undefined

(Optional) Asserts that a cookie must not be sent with cross-origin requests, providing some protection against cross-site request forgery attacks (CSRF)

secure?

boolean | undefined

(Optional) A Boolean indicating if the cookie transmission requires a secure protocol (https). Defaults to false.