io.set('authorization', function (handshake, accept) {
///.......
handshake.user='some string';
accept(null, true);
});
io.on('connection', function(socket){
console.log('a user connected');
console.log(socket.handshake.user);
// .......
});
a user connected
undefined
io.on('connection', function(socket){
console.log('a user connected');
console.log(socket.request.user);
// .......
});