{"repo":"expressjs/cookie-parser","free":true,"listed":false,"github":"https://github.com/expressjs/cookie-parser","clone":"git clone https://github.com/expressjs/cookie-parser.git","description":"Parse HTTP request cookies","language":"JavaScript","stars":2028,"topics":["javascript","expressjs","nodejs","cookie","middleware"],"license":"MIT","category":"dev-tools","readme_excerpt":"cookie-parser [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Test Coverage][coveralls-image]][coveralls-url] Parse Cookie header and populate req.cookies with an object keyed by the cookie names. Optionally you may enable signed cookie support by passing a secret string, which assigns req.secret so it may be used by other middleware. Installation API cookieParser(secret, options) Create a new cookie parser middleware function using the given secret and options . - secret a string or array used for signing cookies. This is optional and if not specified, will not parse signed cookies. If a string is provided, this is used as the secret. If an array is provided, an attempt will be made to unsign the cookie with each secret in order. - options an object that is passed to cookie.parse as the second option. See cookie for more information. - decode a function to decode the value of the cookie The middleware will parse the Cookie header on the request and expose the cookie data as the property req.cookies and, if a secret was provided, as the property req.signedCookies . These properties are name value pairs of the cookie name to cookie value. When secret is provided, this module will unsign and validate any signed cookie values and move those name value pairs from req.cookies into req.signedCookies . A signed cookie is a cookie that has a value prefixed with s: . Signed cookies that fail signature","default_branch":null,"files":null,"tree":[],"storefront":"/r/expressjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/expressjs/cookie-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}