This is important to underdstand for configuration purposes.
If it does implement the touch method than I can safely set resave to false.
session({
// blah blah
resave: false
});
How would I go about looking into this as it is not readily available information on the docs page.
I did find this but I think it is a different touch()
https://redis.io/commands/touch
Yes, the redis connector for express-session implements touch. If you look at the relevant portion of the source for the connect-redis module (which is how redis supports express-session), you will find that it does implement the touch method unless an option is passed to disable it.
Here's the relevant source:
touch(sid, sess, cb = noop) {
if (this.disableTouch) return cb()
let key = this.prefix + sid
this.client.expire(key, this._getTTL(sess), (err, ret) => {
if (err) return cb(err)
if (ret !== 1) return cb(null, 'EXPIRED')
cb(null, 'OK')
})
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With