快递会保留多长时间?

时间:2016-06-15 08:53:34

标签: node.js express sequelize.js express-session

我有一个基于节点的项目如下:

"express": "~4.13.1",
"express-sequelize-session": "^0.4.0",
"express-session": "^1.12.1"

由于我对db行数量有严格的限制,可能主要关注的是:会话存储在db中多长时间,有没有办法修改这些限制?

1 个答案:

答案 0 :(得分:1)

我在express-session支持的商店中看不到express-sequelize-session

您可以使用connect-session-sequelize并指定到期日期。

从自述文件中复制粘贴

app.use(session({
  secret: 'keyboard cat',
  store: new SequelizeStore({
    db: sequelize,
    checkExpirationInterval: 15 * 60 * 1000, // The interval at which to cleanup expired sessions in milliseconds.
    expiration: 24 * 60 * 60 * 1000  // The maximum age (in milliseconds) of a valid session.
  })
}))