New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cookie-monster

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cookie-monster

Browserify-compatible module to get and set cookies in the browser

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
254
decreased by-41.88%
Maintainers
1
Weekly downloads
 
Created
Source

Set and get cookies in the browser or in node with document.

In your browser code with browserify:

var cookie = require('cookie-monster');
var times = parseInt(cookie.get('times'), 10) || 0;
cookie.set('times', times + 1);

and times will increment every time the page is reloaded.

methods

var cookie = require('cookie-monster');

cookie(document)

Return a new cookie object with .get() and .set() operating on document.

document.cookie should be a non-referentially transparent setter/getter combo like the DOM's variant where assignment with optional path and expiry creates a new cookie in the getter as a key=value pair.

cookie.get(key)

Return the cookie value for key.

cookie.set(key, value, opts={})

Set the cookie at key to value with optional parameters expires and path.

To unset a cookie, use a date in the past, ex: { expires: new Date(0) }

install

With npm do:

npm install cookie-cutter

license

MIT/X11

Keywords

FAQs

Package last updated on 16 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