Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/charmander/strict-cookie-middleware

Node.js Connect/Express cookie-parsing middleware
https://github.com/charmander/strict-cookie-middleware

connect cookie expressjs middleware nodejs

Last synced: about 1 month ago
JSON representation

Node.js Connect/Express cookie-parsing middleware

Awesome Lists containing this project

README

        

Strictly cookie-header-parsing middleware. For [Connect][] (Express) applications.

## Usage

```javascript
const strictCookieMiddleware = require('strict-cookie-middleware');

app.use(strictCookieMiddleware);
```

```javascript
const token = req.cookies.get('t');
```

## API

- `request.cookies`

A [Map][] of cookies attached to the request. Empty if the cookie header is invalid.

[Connect]: https://github.com/senchalabs/connect
[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map