NowJS Connect HTTP Session Injection
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
LICENSE
README.md
package.json

README.md

NowJS Connect HTTP Session Injection

NOTE: requires now-middleware (https://github.com/ianserlin/now-middleware)

To enable:


var nowjs = require('now');
require('now-middleware')(nowjs)
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 });

nowjs.sessions(app.SessionStore);

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