1var express = require('express');
2var cookieParser = require('cookie-parser');
3
4var app = express();
5app.use(cookieParser('YOUR-SECRET-SALT'));
6
7app.get('/', (req, res, next) => {
8 res.cookie('name', 'value', { signed: true });
9 res.send('Success');
10});
11
12app.get('/test', (req, res, next) => {
13 req.signedCookies.name; // 'value'
14});