Navigation Menu

Skip to content

Commit

Permalink
Use "cookie" module to parse cookie.
Browse files Browse the repository at this point in the history
parseCookie is removed from connect 2.3.3.
  • Loading branch information
piroor committed Jun 25, 2014
1 parent d4d6001 commit 0910ece
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/adapter/socket.io.js
@@ -1,5 +1,6 @@
var socketIo = require('socket.io');
var connect = require('connect');
var cookie = require('cookie');
var command = require('./command');
var wrapper = require('./wrapper');
var api = require('./api');
Expand Down Expand Up @@ -164,12 +165,11 @@ exports.register = function(application, server, params) {
// share session information with HTTP connections
var sessionStore = params.sessionStore;
if (sessionStore) {
var parseCookie = connect.utils.parseCookie;
//io.configure(function() {
io.set('authorization', function(handshakeData, callback) {
if (handshakeData.headers.cookie) {
var cookie = handshakeData.headers.cookie;
var sessionID = parseCookie(cookie)['connect.sid'];
var sessionID = cookie.parse(cookie)['connect.sid'];
handshakeData.sessionID = sessionID;
sessionStore.get(sessionID, function(error, session) {
if (error) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -21,6 +21,7 @@
"dependencies": {
"body-parser": "*",
"connect": "*",
"cookie": "*",
"errorhandler": "*",
"fluent-logger": "*",
"inflection": "*",
Expand Down

0 comments on commit 0910ece

Please sign in to comment.