Socket
Socket
Sign inDemoInstall

tiny-cookie

Package Overview
Dependencies
0
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tiny-cookie

A tiny cookie manipulation plugin


Version published
Weekly downloads
44K
decreased by-1.8%
Maintainers
1
Install size
109 kB
Created
Weekly downloads
 

Readme

Source

A tiny cookie manipulation plugin.

The tiny-cookie will expose a method Cookie on the global scope. Also, it can be as a CommonJS/AMD module.

Packages

NPM:

npm install tiny-cookie

APIs

Cookie.enabled()

Check if the cookie is enabled.

Cookie.get(key)

Alias: Cookie(key)

Get the cookie value by the given key.

Cookie.set(key, value, options)

Alias: Cookie(key, value, options)

Set a cookie. The options parameter is an object. And its property can be a valid cookie option, such as path, domain, expires/max-age or secure. For example, you can set the expiration:

var now = new Date;
now.setMonth(now.getMonth() + 1);

Cookie.set('foo', 'Foo', { expires: now.toGMTString() });

Cookie.remove(key)

Alias: Cookie(key, null)

Remove a cookie.

License

MIT.

Keywords

FAQs

Last updated on 25 May 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc