Socket.io authorization is sending the wrong cookie?

I am using nodejs and sockets to perform an authorization, but the cookie that gets sent via the browser seems to be corrupt.

if (data.headers.cookie) {
    data.cookie = utils.parseCookie(data.headers.cookie);
    if (data.cookie['connect.sid']) {
        data.sessionID = data.cookie['connect.sid'];
        ...
    }
}

The sessionID is not matching the database record for some reason. Any thoughts on what uis going on? I am using express and mongo for a session store.

Try seeing if the cookie sid sent over matches your database record when you do:

data.sessionID = data.cookie['connect.sid'].split('.')[0].substring(2);