Answers for "express signed cookies"

0

express signed cookies

var express = require('express');
var cookieParser = require('cookie-parser');

var app = express();
app.use(cookieParser('YOUR-SECRET-SALT'));

app.get('/', (req, res, next) => {
  res.cookie('name', 'value', { signed: true });
  res.send('Success');
});

app.get('/test', (req, res, next) => {
  req.signedCookies.name; // 'value'
});
Posted by: Guest on October-26-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language