interface CookieAttributes {
    domain?: string;
    expires?: number | Date;
    path?: string;
    sameSite?: "none" | "strict" | "Strict" | "lax" | "Lax" | "None";
    secure?: boolean;
    [property: string]: any;
}

Indexable

[property: string]: any

An attribute which will be serialized, conformably to RFC 6265 section 5.2.

Properties

domain?: string

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

expires?: number | Date

Define when the cookie will be removed. Value can be a Number which will be interpreted as days from time of creation or a Date instance. If omitted, the cookie becomes a session cookie.

path?: string

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

sameSite?: "none" | "strict" | "Strict" | "lax" | "Lax" | "None"

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

secure?: boolean

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