darul75/express-session-json — pull request #8 by michaldudek (2014-12-07 21:43:24+00:00)
Title: Fix .destroy() not calling callback

`JsonStore.prototype.destroy()` should call the given callback even if there were no sessions to destroy.

Because the callback wasn't called in case when there were no session to destroy, the below code never sent response to the client:

```
app.delete('/logout', function(req, res) {
req.session.destroy(function() {
res.send('{}');
});
});
```

The above callback gets called, but when `express-session` overwrites `res.end()` method it also calls `store.destroy()` again ( https://github.com/expressjs/session/blob/master/index.js#L250 ) and this time this callback never gets sent.