Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cookie-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie-js

cookie parsing and serialization for the browser!

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
588
increased by22.5%
Maintainers
1
Weekly downloads
 
Created
Source

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.

how?

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' };

more

The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.

path

cookie path

expires

absolute expiration date for the cookie (Date object)

maxAge

relative max age of the cookie from when the client receives it (seconds)

domain

domain for the cookie

secure

true or false

httpOnly

true or false

Keywords

FAQs

Package last updated on 01 Oct 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc