I set the expiration time of session to 7 days according to the way on the Internet, but it will expire after a while, probably less than half an hour. May I ask how to solve it?
express version is above 4.0. here is the configuration code:
var express = require ("express");
var app = express ();
var router = require (". / router/mainRouter.js");
/ / var adminRouter = require (". / router/adminRouter.js");
var session = require ("express-session");
var db = require (". / models/db.js");
/ / use session
app.use (session ({
secret: "keyboard cat",
cookie: { maxAge: 604800000},
resave: true,
saveUninitialized: true,
rolling: true
}));