Cookie
react-router

Cookie interface

A HTTP cookie.

A Cookie is a logical container for metadata about a HTTP cookie; its name and options. But it doesn't contain a value. Instead, it has parse() and serialize() methods that allow a single instance to be reused for parsing/encoding multiple different values.

Properties

expires

Type: Date

The Date this cookie expires.

Note: This is calculated at access time using maxAge when no expires option is provided to createCookie().

isSigned

Type: boolean

True if this cookie uses one or more secrets for verification.

name

Type: string

The name of the cookie, used in the Cookie and Set-Cookie headers.

Methods

parse

Type: parse(cookieHeader, options): Promise<any>

serialize

Type: serialize(value, options): Promise<string>

Docs and examples CC 4.0