connect-mongodb-session icon indicating copy to clipboard operation
connect-mongodb-session copied to clipboard

on session destroy add a callback function

Open cookie-ag opened this issue 9 years ago • 2 comments

I want to trigger a event as soon a session is destroyed, something like this:

var store = new MongoStore()

store.on('destroy', function (sess) {
  // react to your store destroying a session
})

app.use(expressSession({ store: store }))

Is this supported?

cookie-ag avatar Sep 07 '16 19:09 cookie-ag

Not currently supported, but PRs are welcome.

vkarpov15 avatar Sep 16 '16 00:09 vkarpov15

you should rather have a callback or trigger an event where/when you do req.session.destroy()

caub avatar Oct 31 '16 21:10 caub