# redux-storage-engine-cookies

> cookie engine for redux-storage

Latest version **1.0.0** (published 2016-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-storage-engine-cookies
pnpm add redux-storage-engine-cookies
yarn add redux-storage-engine-cookies
bun add redux-storage-engine-cookies
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-07-21 |
| First published | 2016-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Bob Matcuk |
| Maintainers | bmatcuk |
| Keywords | redux, redux-storage, redux-storage-engine, cookies |

## Links

- npm: https://www.npmjs.com/package/redux-storage-engine-cookies
- Repository: https://github.com/bmatcuk/redux-storage-engine-cookies
- Issues: https://github.com/bmatcuk/redux-storage-engine-cookies/issues
- npm.io page: https://npm.io/package/redux-storage-engine-cookies

## Dependencies (1)

- [js-cookie](https://npm.io/package/js-cookie.md) ^2.1.2

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-07-21

## README

# [redux-storage-engine-cookies][]

[![dependencies](https://david-dm.org/bmatcuk/redux-storage-engine-cookies.svg)](https://david-dm.org/bmatcuk/redux-storage-engine-cookies)
[![devDependencies](https://david-dm.org/bmatcuk/redux-storage-engine-cookies/dev-status.svg)](https://david-dm.org/bmatcuk/redux-storage-engine-cookies#info=devDependencies)

[![license](https://img.shields.io/npm/l/redux-storage-engine-cookies.svg?style=flat-square)](https://www.npmjs.com/package/redux-storage-engine-cookies)
[![npm version](https://img.shields.io/npm/v/redux-storage-engine-cookies.svg?style=flat-square)](https://www.npmjs.com/package/redux-storage-engine-cookies)
[![npm downloads](https://img.shields.io/npm/dm/redux-storage-engine-cookies.svg?style=flat-square)](https://www.npmjs.com/package/redux-storage-engine-cookies)

`document.cookie` based engine for [redux-storage][].

## Installation

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

## Usage

Stores everything inside a cookie.

```js
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.

  [redux-storage]: https://github.com/michaelcontento/redux-storage
  [redux-storage-engine-cookies]: https://github.com/bmatcuk/redux-storage-engine-cookies
  [js-cookie]: https://github.com/js-cookie/js-cookie#cookie-attributes
  [es6-promise]: https://github.com/stefanpenner/es6-promise

---
_Source: https://npm.io/package/redux-storage-engine-cookies · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
