Chocolate Chip
A tiny CommonJS cookie toolkit.
Install
First install Chocolate Chip in your project root.
$ npm install --save chocolate-chip
Then include in your module using require().
var cookie = ;
Use
Set cookie
cookie;
Options
opts
is an object that allows the following options:
end
: Maximum cookie age in milliseconds orInfinity
. Set as GMTString orDate
to specify an end date.path
: Path from where the cookie will be readable.domain
: Domain from where the cookie will be readablesecure
: Cookie only transmitted over secure protocols if set totrue
.
Get cookie
cookie;
Remove cookie
cookie;
Set cookie forever
Shorthand for cookie.set()
, sets end
to Infinity
.
cookie;