node 报错 deprecated undefined

283 阅读1分钟

背景:运行node程序时,终端报错:


解决方法:

app.use(session({
  resave: false, //添加 resave 选项
  saveUninitialized: true, //添加 saveUninitialized 选项
  secret: 'aF,.j)wBhq+E9n#aHHZ91Ba!VaoMfC', // 建议使用 128 个字符的随机字符串
  cookie: { maxAge: 60 * 1000 }
}));

原文链接