Flexible Cookies 🍪
flexible-cookies is a flexible way to manage cookies in javascript/node.js.
Installation
npm install --save flexible-cookies
Basic Usage
;// or default import
Set cookie
Cookies;
Get cookie
const cookieValue = Cookies;
Delete cookie
Cookies;
Configuration
You can specify a source where flexible-cookies will read/edit the cookie.
By default, the source is document
(which is the browser working-behavior) but you can change it to make cookies working in a server context:
Cookies;const cookieValue = Cookies;console // Hello !
Cookie validity duration
By default, the cookie is valid until the browser session is closed, but you can increase the validity duration of the cookie:
Cookies;
Cookie path
Cookies;