Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Because connect sessions depend too heavily on `this`
JavaScript
branch: master

0.1.0

latest commit 803ac464d5
@phated authored
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){});
});
Something went wrong with that request. Please try again.