node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


Build Status


Because connect sessions depend too heavily on this


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){});;       // analogous to{});