Express-session middleware session can not get the problem

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

Mar.21,2021

Brother is currently having a headache


the server thinks that your request is initiated by two different clients, so the second request is undefined


I also encounter this situation. Just remove maxAge: 100000

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36aa4-2c014.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36aa4-2c014.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?