express-session deprecated undefined resave option; provide resave option app.js :16:9

express-session deprecated undefined resave option; provide resave option app.js:16:9
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option app.js:16:9

解决方法

app.use(session({
  resave:false,//添加这行
  saveUninitialized: true,//添加这行 
  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
  })
}));

你可能感兴趣的:(node)