Working on an application using Node.js/Socket.IO that requires wide browser compatibility, so its expected that clients may not have WebSocket support in their browsers. I wanted to know whats the most robust way to authenticate users no matter the underlying transport.
There are a number of examples which send a cookie with the sessionID on the connect/handshake which is ideal but I'm concerned that this wont work with Flash Sockets as the cookies sent are different.
The other approach is to get the client to store the SessionID when the user authenticates and then when the user requires Socket connection you send the session ID though as the first message. The issue with this approach is you incur overhead of establishing a full connection which is not ideal from a load or security perspective.
What is the best authentication pattern using Socket.IO during the connection/handshake phase (i.e. not sending a token through the connected socket), not matter what underlying transport mechanism is used between the client & server?