Contents

Cookie

A cookie in the session’s cookie store.

Properties 

name 

readonly name: string;

The name of the cookie.

value 

readonly value: string;

The value of the cookie.

domain 

readonly domain: string;

The domain of the cookie.

A domain cookie is stored with a leading dot, so that it also applies to subdomains: a cookie for .example.com is sent to www.example.com as well. A host-only cookie has no leading dot.

hostOnly 

readonly hostOnly: boolean;

Whether the cookie applies only to the exact host it was set on.

True when the cookie was stored without a domain attribute.

path 

readonly path: string;

The path of the cookie.

secure 

readonly secure: boolean;

Whether the cookie is sent over secure connections only.

httpOnly 

readonly httpOnly: boolean;

Whether the cookie is hidden from scripts running in the page.

session 

readonly session: boolean;

Whether the cookie lasts only for the current session.

A session cookie has no expiry and is discarded when the application quits. A persistent cookie has an expirationDate and survives restarts.

expirationDate 

readonly expirationDate?: number;

When the cookie expires, in seconds since the UNIX epoch.

Absent for session cookies.

sameSite 

readonly sameSite: CookieSameSite;

The SameSite policy applied to the cookie.