Skip to content


Subversion checkout URL

You can clone with
Download ZIP
session middleware for
branch: master

This branch is even with turbonetix:master

Failed to load latest commit information.
lib fixed potential runtime error
spec fixed issue with sessin
.gitignore added dev env
.npmignore added dev env
.travis.yml added dev env added dev env
LICENSE updated license updated doc
index.js added first test
package.json Updated deps

Build Status NPM version David DM

Session middleware for v1.x;


var socketSessions = require('');
var io = require('')(3000);
io.use( socketSessions() );

Using connect-redis for our session store.

var session = require('express-session');
var RedisStore = require('connect-redis')(session);
var sessionStore = new RedisStore();
var cookieParser = require('cookie-parser');
var socketHandshake = require('');

var io = require('')(3000);
io.use(socketHandshake({store: sessionStore, key:'sid', secret:'secret', parser:cookieParser()}));

To access the session data.

io.on('connection' function (sock) {
  if (! {
    sock.emit('get name');
  sock.on('set nama', function (name) { = name;;

Installation and Environment Setup

Install node.js (See download and install instructions here:

Clone this repository

> git clone

cd into the directory and install the dependencies

> cd
> npm install && npm shrinkwrap --dev

Running Tests

Install coffee-script

> npm install coffee-script -g

Tests are run using grunt. You must first globally install the grunt-cli with npm.

> sudo npm install -g grunt-cli

Unit Tests

To run the tests, just run grunt

> grunt spec


Something went wrong with that request. Please try again.