cookie-signature

Sign and unsign cookies

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
cookie-signature
14911.2.09 months ago10 years agoMinified + gzip package size for cookie-signature in KB

Readme

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.