I have two requests, an and b. When I set up session, through an and then visit B, what is the undefined, request?
const express = require("express");
const app = express();
const session = require("express-session");
app.use(session({
secret: "key", // session id cookie
resave: false,
saveUninitialized: true, //
cookie: {
maxAge: 100000, // session
secure: true
},
}));
app.post("/a",function(req, res) {
req.session.name = "Thomas";
});
app.post("/b", function(req, res) {
console.log(req.session.name) //undefined
});
< hr >
big head, help you edit