How to use the express-session.Store.call function in express-session

To help you get started, we’ve selected a few express-session examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cobyism / ghost-on-heroku / core / server / bookshelf-session.js View on Github external
BSStore = function BSStore(options) {
    var self = this;
    options = options || {};
    Store.call(this, options);

    models.Session.findAll()
        .then(function (model) {
            var i,
                now = new Date().getTime();
            for (i = 0; i < model.length; i = i + 1) {
                if (now > model.at(i).get('expires')) {
                    self.destroy(model.at(i).get('id'));
                }
            }
        });
};