I found the right answer to get a session from a cookie, you must first analyze the cookie
handshakeData.cookie = cookie.parse(handshakeData.headers.cookie);
Than you should decode the cookie, I used the original function from the client-session module
var clientSessions = require('./node_modules/client-sessions/lib/client-sessions')
var opts = {
cookieName: 'yourSessionName'
, secret: 'secret'
}
var decoded = clientSessions.util.decode(opts, handshakeData.cookie['yourSessionName'])
decoded object stores your session data
source
share