I want to set some user information in a cookie and be able to access it on connection, is this possible?
client.request.headers.cookie
leads to race conditions as the cookie always points to the last logged in user.
Please see: Socket.IO Authentication.
Using Socket.IO 0.8.7, you can access request headers via:
socket.handshake.headers
You can find more detail on this at https://github.com/LearnBoost/socket.io/wiki/Authorizing