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 Apr 29, 2024 via pnpm

cookie-parser 1.3.5

cookie parsing with signatures
Package summary
Share
0
issues
1
license
3
MIT
Package created
15 Feb 2014
Version published
20 May 2015
Maintainers
2
Total deps
3
Direct deps
2
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
3 Packages, Including:
cookie-parser@1.3.5
cookie-signature@1.0.6
cookie@0.1.3
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

2
All Dependencies CSV
β“˜ This is a list of cookie-parser 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
cookie-signature1.0.62.06 kBMIT
prod
cookie0.1.32.77 kBMIT
prod

Visualizations

Frequently Asked Questions

What does cookie-parser do?

Cookie-Parser is a popular npm package specifically designed to parse HTTP request cookies. It can key the 'Cookie' header and populate req.cookies with an object thereby making it easier to manage and control web cookies. Furthermore, it has an additional feature enabling signed cookies support by passing a secret string, which assigns req.secret so it may be used by other middleware. This optional feature enhances the security by validating the signed cookie values, and the module unsigns and validates any signed cookie values.

How do you use cookie-parser?

To use the Cookie-Parser, first, you need to install it via npm with npm install cookie-parser. After installing, you can include it in your JavaScript application using the require function:

var cookieParser = require('cookie-parser')

In your application, initialize and use it like this:

var express = require('express')
var cookieParser = require('cookie-parser')

var app = express()
app.use(cookieParser())

app.get('/', function (req, res) {
  // Cookies that have not been signed
  console.log('Cookies: ', req.cookies)

  // Cookies that have been signed
  console.log('Signed Cookies: ', req.signedCookies)
})

app.listen(8080)

In this example, we've set up a simple Express.js server using cookie-parser as middleware. The cookies of each request can be logged in two categories, Cookies that have not been signed and Cookies that have been signed, through req.cookies and req.signedCookies respectively.

Where are the cookie-parser docs?

The entire documentation for the cookie-parser npm package can be found in the comprehensive README.md file included within the package's GitHub repository. The URL for the repository is git+https://github.com/expressjs/cookie-parser.git. Here you'll find detailed instructions on installing and using the library, as well as its full API reference and example usage snippets. Looking up this URL would give you access to a wealth of information about the cookie-parser package right at your fingertips.