The documentation for koa-generic-session shows milliseconds (ms) are supposed to be used, instead of seconds. For example, this should have a TTL of 1 day, but SQLite3Store gives it a TTL of 1,000 days:
app.use(session({
store: new SQLite3Store('filename.db'),
ttl: 86400000 // ms
});
It works great if you pass in seconds:
app.use(session({
store: new SQLite3Store('filename.db'),
ttl: 86400
});
One nice thing about koa-generic-session is that you can swap out one session provider for another. For example you could use SQLite for sessions when doing local development, and Redis on a production server. But with this difference you can’t share the same config between koa-redis and koa-sqlite3-session.
The documentation for
koa-generic-session
shows milliseconds (ms) are supposed to be used, instead of seconds. For example, this should have a TTL of 1 day, but SQLite3Store gives it a TTL of 1,000 days:It works great if you pass in seconds:
One nice thing about koa-generic-session is that you can swap out one session provider for another. For example you could use SQLite for sessions when doing local development, and Redis on a production server. But with this difference you can’t share the same config between koa-redis and koa-sqlite3-session.