【发布时间】:2015-12-24 16:51:16
【问题描述】:
我在我的 Node.js 应用程序中使用会话管理。默认快速会话可用于 Express MVC 应用程序。 在 app.js 文件中,我包含了我的 cookie 和会话过期时间。
app.use(session({
secret: 'ssshhhhh',
saveUninitialized: true,
resave: true,
cookie:{maxAge:new Date(Date.now() + 1800000),expires:1800000},rolling:true})
);
但是当我执行我的代码时,它会抛出 ans Error Called TypeError: Object 1800000 has no method 'toUTCString' 请为此提供任何可行的解决方案。
【问题讨论】:
标签: node.js session express cookies