# cookie-signature

> Sign and unsign cookies

Latest version **1.2.2** (published 2024-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install cookie-signature
pnpm add cookie-signature
yarn add cookie-signature
bun add cookie-signature
```

## Health

**Score 33/100 (F)** — status: maintenance-mode.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2024-10-29 |
| First published | 2012-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/cookie-signature) |
| Module format | CommonJS |
| Node | >=6.6.0 |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 192 |
| Author | TJ Holowaychuk |
| Maintainers | natevw, tjholowaychuk, dougwilson |
| Keywords | cookie, sign, unsign |

## Links

- npm: https://www.npmjs.com/package/cookie-signature
- Repository: https://github.com/visionmedia/node-cookie-signature
- Homepage: https://github.com/visionmedia/node-cookie-signature#readme
- Issues: https://github.com/visionmedia/node-cookie-signature/issues
- npm.io page: https://npm.io/package/cookie-signature

## Recent versions

- 1.2.2 (latest) — 2024-10-29
- 1.0.7 — 2023-04-12
- 1.2.1 — 2023-02-27
- 1.2.0 — 2022-02-17
- 1.1.0 — 2018-01-19
- 1.0.6 — 2015-02-03
- 1.0.5 — 2014-09-05
- 1.0.4 — 2014-06-25
- 1.0.3 — 2014-01-29
- 1.0.2 — 2014-01-29
- 1.0.1 — 2013-04-15
- 1.0.0 — 2013-04-12
- 0.0.1 — 2012-10-15

## README

# cookie-signature

  Sign and unsign cookies.

## Example

```js
var cookie = require('cookie-signature');

var val = cookie.sign('hello', 'tobiiscool');
val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');

var val = cookie.sign('hello', 'tobiiscool');
cookie.unsign(val, 'tobiiscool').should.equal('hello');
cookie.unsign(val, 'luna').should.be.false;
```

## License

MIT.

See LICENSE file for details.

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