merge socket.io and express.js sessions <p>I want to merge express.js and socket.io sessions together. Below is my code (socket.io part)</p> <pre><code>var io = require('socket.io').listen(app); io.set('log level', 1); io.sockets.on('connection', function (socket) { console.log('client connected'); client.send(client.id);//send client id to client itself socket.on('connect', function(){ console.log(socket.id + ' connected'); }); socket.on('disconnect', function(){ console.log(socket.id + ' disconnected'); }); }); </code></pre> <p>My express.js Session settings:</p> <pre><code>app.configure(function() { //app.use(express.logger()); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/static')); app.use(express.cookieParser()); app.use(express.session({store: MemStore({ reapInterval: 60000 * 10 }), secret:'foobar', key: 'express.sid' })); </code></pre> <p>My main problem is in my terminal when user travels from one url to another, the session id changes also: But I don't want it to be changed.</p> <pre><code>info - socket.io started client connected client connected 4Z0bYHzfWCEFzbbe4WUK disconnected e_uSvxhSLbLAC9-F4WUL disconnected client connected bKDy90gsrWWTRJDD4WUM disconnected client connected RJ5qqCL2wfmXbd7U4WUN disconnected client connected wjN5Sqx4rucRtWL_4WUO disconnected </code></pre>