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

redux-storage-engine-cookies

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

redux-storage-engine-cookies

cookie engine for redux-storage

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

redux-storage-engine-cookies

dependencies devDependencies

license npm version npm downloads

document.cookie based engine for redux-storage.

Installation

npm install --save redux-storage-engine-cookies

Usage

Stores everything inside a cookie.

import createEngine from 'redux-storage-engine-cookies';
const engine = createEngine('my-save-key', options);

options is an optional hash of options to pass to js-cookie. These options include:

  • options.expires: Either a number representing the number of days the cookie will persist, or a Date object. If omitted, the cookie will be a session cookie.
  • options.path: path under which the cookie is valid. Default is /. Due to an IE bug, do not include a filename in the path (such as /path/to/file.ext). IE will be unable to read the cookie if you do this. Instead, just use a path like /path/to/.
  • options.domain: What domain the cookie is valid on. By default, it will be valid on the domain where the cookie is created. IE allows cookies to be accessed under all nested subdomains as well (such as sub1.sub2.example.org).
  • options.secure: If true, requires HTTPS. Default is false.

See js-cookie for additional documentation for these options.

Warning: Browsers allocate a very limited amount of space to cookies, so don't expect to be able to store a large amount of data here! IE, for example, limits all cookies to a total of 4096 bytes. If you have multiple cookies on your domain, this means that the number of bytes you can store might be significantly less than 4096 since you must share storage space with the other cookies.

Warning: document.cookie does not expose a async API and every save/load operation will block the JS thread!

Warning: Some browsers like IE<=11 do not support Promises! You could use something like es6-promise to polyfill.

Keywords

FAQs

Package last updated on 21 Jul 2016

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