Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
cookie-js is a basic cookie parser and serializer for web browsers. It was forked from https://github.com/defunctzombie/node-cookie. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers.
See RFC6265 for details about the http header for cookies.
bower install cookie-js
var hdr = cookiejs.serialize('foo', 'bar');
// hdr = 'foo=bar';
var cookies = cookiejs.parse('foo=bar; cat=meow; dog=ruff');
// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };
The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.
cookie path
absolute expiration date for the cookie (Date object)
relative max age of the cookie from when the client receives it (seconds)
domain for the cookie
true or false
true or false
FAQs
cookie parsing and serialization for the browser!
The npm package cookie-js receives a total of 574 weekly downloads. As such, cookie-js popularity was classified as not popular.
We found that cookie-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.