Interface Cookie
domain?: string;
expires?: number | Date;
httpOnly?: boolean;
maxAge?: number;
name: string;
partitioned?: boolean;
path?: string;
sameSite?: "Strict" | "Lax" | "None";
secure?: boolean;
unparsed?: string[];
value: string;
}
Properties
Optionaldomain
The cookie's Domain attribute. Specifies those hosts to which the cookie
will be sent.
Optionalexpires
The cookie's Expires attribute, either as an explicit date or UTC
milliseconds. If undefined, the cookie will expire when the client's
session ends.
OptionalhttpOnly
The cookie's HTTPOnly attribute. If true, the cookie cannot be accessed via JavaScript.
OptionalmaxAge
The cookie's Max-Age attribute, in seconds. Must be a non-negative
integer. A cookie with a maxAge of 0 expires immediately.
name
Name of the cookie.
Optionalpartitioned
The cookie's Partitioned attribute.
If true, the cookie will be only be included in the Cookie request header if
the domain it is embedded by matches the domain the cookie was originally set from.
Warning: This is an attribute that has not been fully standardized yet. It may change in the future without following the semver semantics of the package. Clients may ignore the attribute until they understand it.
Optionalpath
The cookie's Path attribute. A cookie with a path will only be included
in the Cookie request header if the requested URL matches that path.
OptionalsameSite
Allows servers to assert that a cookie ought not to be sent along with cross-site requests.
Optionalsecure
The cookie's Secure attribute. If true, the cookie will only be
included in the Cookie request header if the connection uses SSL and
HTTPS.
Optionalunparsed
Additional key value pairs with the form "key=value".
value
Value of the cookie.
Represents an HTTP Cookie.
See
https://www.rfc-editor.org/rfc/rfc6265.html#section-4.2.1