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

cookie 0.5.0

HTTP server cookie parsing and serialization
Package summary
Share
0
issues
1
license
1
MIT
Package created
28 May 2012
Version published
11 Apr 2022
Maintainers
1
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@0.5.0
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 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does cookie do?

"Cookie" is a widely-used npm package and a basic HTTP server cookie parser and serializer. With the help of "cookie", you can manage your cookies on the HTTP server. It allows you to parse an HTTP 'Cookie' header string and return an object of all cookie name-value pairs. Similarly, it provides you with the function to serialize a cookie name-value pair into a Set-Cookie header string.

How do you use cookie?

To use the "cookie" package, you need to install it first through the npm registry. Use the npm install command as follows:

$ npm install cookie

Once the installation is complete, you require the package into your JavaScript file:

var cookie = require('cookie');

You can use methods provided by "cookie" to parse and serialize cookies.

To parse a cookie, use the parse function of cookie:

var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2');
// { foo: 'bar', equation: 'E=mc^2' }

The parse function takes a string representing a Cookie header value and an optional options object.

To serialize a cookie, use the serialize function:

var setCookie = cookie.serialize('foo', 'bar');
// foo=bar

The serialize function takes a name for the cookie, a value to set the cookie to, and an optional options object for additional serialization options.

Where are the cookie docs?

The documentation for the "cookie" npm package is available within the README file on the project's official GitHub repository (https://github.com/jshttp/cookie.git). This README file provides comprehensive information regarding installation, API usage, options, testing, and references, making it a reliable resource for developers seeking to understand and use the "cookie" npm package in their JavaScript projects.