Files
book-test/node_modules/cookie-signature
chris d4fae15f5c
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-internal (push) Has been cancelled
Initial code test
2026-08-26 11:51:58 -04:00
..
2026-08-26 11:51:58 -04:00
2026-08-26 11:51:58 -04:00
2026-08-26 11:51:58 -04:00
2026-08-26 11:51:58 -04:00
2026-08-26 11:51:58 -04:00

cookie-signature

Sign and unsign cookies.

Example

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.