Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 5, 2024 via pnpm

cookie-signature 1.0.6

Sign and unsign cookies
Package summary
Share
0
issues
1
license
1
MIT
Package created
15 Oct 2012
Version published
3 Feb 2015
Maintainers
3
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
cookie-signature@1.0.6
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of cookie-signature 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does cookie-signature do?

Cookie-signature is a powerful npm package primarily designed to secure cookies by signing and unsigning them. It boosts the security of cookie-based applications by preventing tampering and making your cookies more secure.

How do you use cookie-signature?

Using cookie-signature is quite simple and straightforward. Firstly, you need to install the package into your project using npm - npm install cookie-signature. Then, you can require the package and use its sign and unsign methods as shown in the example below:

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

// signing a cookie
var val = cookie.sign('hello', 'tobiiscool');
console.log(val);  // outputs: hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI

// unsigning a cookie
var origValue = cookie.unsign(val, 'tobiiscool');
console.log(origValue);  // outputs: hello

// unsigning a cookie with wrong secret returns false
var wrongValue = cookie.unsign(val, 'luna');
console.log(wrongValue);  // outputs: false

In the above code, 'hello' is the value of the cookie and 'tobiiscool' is the secret with which the cookie is signed or unsigned.

Where are the cookie-signature docs?

Unfortunately, there is no separate documentation provided for cookie-signature. Most of the vital information you need to use the package can be found in the readme of the package's GitHub repository. You can view various usage examples and explanations directly on the GitHub repo.