Because connect sessions depend too heavily on `this`
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

Build Status

connect-session-as-promised

Because connect sessions depend too heavily on this

Usage

Exposes regenerate, destroy, reload & save which are analogous to Connect Session methods of the same names

The only difference is that they return a promise that is resolved or rejected based on the result of the session call.

var session = require('connect-session-as-promised');

app.get('/', function(req, res){
  session.regenerate(req); // analogous to req.session.regenerate(function(err){});
  session.destroy(req);    // analogous to req.session.destroy(function(err){});
  session.reload(req);     // analogous to req.session.reload(function(err){});
  session.save(req);       // analogous to req.session.save(function(err){});
});