Nodejs express configuration session starts, and the express session cancelled undefined save option appears; provide resave option app.js
Solution:
app.use(session({
resave:false,//added
saveUninitialized: true,//added
secret: settings.cookieSecret,
key: settings.db,//cookie name
cookie: {maxAge: 1000 * 60 * 60 * 24 * 30},//30 days
store: new MongoStore({
db: settings.db,
host: settings.host,
port: settings.port
})
}));
Similar Posts:
- Laravel [1045] Solution Access denied for user’homestead’@’localhost’
- [Solved] Nodejs Error: Cannot find module ‘express’
- What happened to CodeIgniter disallowed key characters?
- [Solved] cookie loss when uploading components using the elementui framework El upload
- [Solved] Node Error: DeprecationWarning: current URL string parser is deprecated and Port 3000 is already in use
- The problem and solution of local storage in Safari under IOS
- javax.mail.MessagingException: Could not convert socket to TLS
- SSH link encountered error [remote host identification has changed!]
- For the problem of establishing SSL connection in mysql, set usessl = false to explicitly disable SSL, or set usessl = true
- FileZilla 425 Can’t open data connection