# cookie-redis-store

> Store cookie in Redis

Latest version **0.0.2** (published 2018-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install cookie-redis-store
pnpm add cookie-redis-store
yarn add cookie-redis-store
bun add cookie-redis-store
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-08-26 |
| First published | 2018-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Coghub |
| Maintainers | caiofnds |

## Links

- npm: https://www.npmjs.com/package/cookie-redis-store
- Repository: https://github.com/coghub/cookie-redis-store
- Homepage: https://github.com/coghub/cookie-redis-store#readme
- Issues: https://github.com/coghub/cookie-redis-store/issues
- npm.io page: https://npm.io/package/cookie-redis-store

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) ^3.1.0
- [deasync](https://npm.io/package/deasync.md) ^0.1.13
- [ioredis](https://npm.io/package/ioredis.md) ^4.0.0
- [request](https://npm.io/package/request.md) ^2.88.0
- [tough-cookie](https://npm.io/package/tough-cookie.md) ^2.4.3
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.2

## Recent versions

- 0.0.2 (latest) — 2018-08-26
- 0.0.1 — 2018-08-26

## README

# Cookie Redis Store

Supports Redis >= 2.6.12 and (Node.js >= 6).

# Description
Another redis store for tough-cookie module.

## Install
```shell
$ npm install cookie-redis-store
```

## Basic Usage
``` javascript
const rp = require('request-promise');

const CookieRedisStore = require('cookie-redis-store');

const jar = rp.jar(new CookieRedisStore());

(async () => {
  const qs = {
    key: 'value',
    anotherkey: 'something',
    someelse: 'content',
  };

  const response = await rp('https://httpbin.org/cookies/set', { qs, jar, json: true });

  console.log(response);
})();
```
## Options

  * `path` **optional** You can specify which Redis address to connect. [*default:* 'localhost:6379 db 0']
  * `id` **optional** ID for each redis store so that we can use multiple stores with the same redis database [*default:* 'default']

``` javascript
const rp = require('request-promise');

const CookieRedisStore = require('cookie-redis-store');

// Connect to 127.0.0.1:6380, db 4, using password "authpassword" and stores on key "my-cookie"
const jar = rp.jar(new CookieRedisStore('redis://:authpassword@127.0.0.1:6380/4', 'my-cookie'));

(async () => {
  const qs = {
    key: 'value',
    anotherkey: 'something',
    someelse: 'content',
  };

  const response = await rp('https://httpbin.org/cookies/set', { qs, jar, json: true });

  console.log(response);
})();

```

---
_Source: https://npm.io/package/cookie-redis-store · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
