node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey ยป


NowJS Connect HTTP Session Injection

To enable:

var nowjs = require('now'); require('now-sessions')(nowjs);

To activate, when you're ready:

nowjs.sessions( sessionStore, sessionKey );

For example:

// Session Store
var MemoryStore = require('express/node_modules/connect/lib/middleware/session').MemoryStore;
app.SessionStore = new MemoryStore({ reapInterval: 60000 * 10 });


Parameters are:

  • the Connect-compliant SessionStore you are using (really the session store just needs to support the .get() method)
  • the connect session key you are using to store the session id in the user's cookie, default is 'connect.sid' if you omit this parameter