Skip to main content

CookieData

A data structure describing a Cookie to be set, or one that’s been read.

Learn more

Index

Properties

name

name: string

The name of the cookie.

value

value: string

The value of the cookie.

optionaldomain

domain?: string

The domain this cookie is visible to.

Defaults to the current browsing context’s document’s URL when setting a cookie.

optionalpath

path?: string

The cookie path. Defaults to “/“ when adding a cookie.

optionalexpiry

expiry?: Timestamp

The Timestamp describing the point in time when this cookie expires.

optionalhttpOnly

httpOnly?: boolean

Whether the cookie is an HTTP-only cookie. Defaults to false when adding a new cookie.

optionalsecure

secure?: boolean

Whether the cookie is a secure cookie. Defaults to false when adding a new cookie.

optionalsameSite

sameSite?: Lax | Strict | None

Whether the cookie applies to a SameSite policy. Defaults to None if omitted when adding a cookie.