Answers for "express set cookie"

4

express get cookie

const cookieParser = require('cookie-parser');
const express = require('express');
const app = express();
app.use(cookieParser());

app.get('/', (req, res) => {
  console.log('Cookies: ', req.cookies);
  console.log('Signed Cookies: ', req.signedCookies);
});

app.listen(3000);
Posted by: Guest on August-27-2020
9

set cookie in node

res.setHeader('Set-Cookie','visited=true; Max-Age=3000; HttpOnly, Secure');
Posted by: Guest on April-16-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language