Load and save cookies with React
$ yarn add react-cookies
Set a cookie.
The cookie name
Type: string
Required
The cookie value
Type: any
Required
Support all the cookie options from the RFC 6265.
Type: object
- expire: Indicates the maximum lifetime of the cookie represented as the date and time
- maxAge: Indicates the maximum lifetime of the cookie represented as the number of seconds
- domain: Specifies those hosts to which the cookie will be sent
- path: The scope of each cookie is limited to a set of paths
- secure: Limits the scope of the cookie to "secure" channels (where "secure" is defined by the user agent)
- httpOnly: Limits the scope of the cookie to HTTP requests
Get a cookie.
The cookie name.
Type: string
Required
Remove a cookie.
The cookie name.
Type: string
Required
Get all cookies.
MIT © Bu Kinoshita