mongodb-js/connect-mongodb-session

touch should be supported

evictor opened this issue · 0 comments

I'm aware of this closed issue regarding resave: #24

I would like support in this plugin for the touch method to avoid having to use resave: true. The reason is that the latter is not safe when many requests might be happening at once against the same session, which is not uncommon for a Web app with a bunch of async XHRs firing at once on a page.

It's very difficult to prove but I (and some of my product's users) believe I have witnessed this in practice with symptoms of race condition-type problems related to session saving.

Touch support should be easy, I imagine; is it no just updating some sort of "last active" timestamp in the DB? I wouldn't mind submitting a PR as such...