universal-cookie-express
v7.2.2
Published
Hook cookies get/set on Express for server-rendering
Downloads
113,220
Maintainers
Readme
Integrations
State management integration
universal-cookie
- Universal cookies for JavaScriptreact-cookie
- Universal cookies for React
Getting started
npm install universal-cookie-express --save
Usage
cookiesMiddleware()
express middleware set req.universalCookies
Example
const express = require('express');
const cookiesMiddleware = require('universal-cookie-express');
const app = express();
app.use(cookiesMiddleware()).use(function (req, res) {
// get the user cookies using universal-cookie
req.universalCookies.get('myCat');
});