I have the following code:
io.sockets.on('connection', function (socket) {
socket.on('queue', function() {
console.log(socket.request.headers.cookie);
})
});
Now registration to my website is done by express and an https cookie is added to the client's browser by express. When someone wants to connect to my, let's say game he needs to emit a "queue event". there, socket.io will read his cookies and check if they are correct.
According to this thread: Can I access a cookie from Socket.io?
socket.request.headers.cookie
headers.cookie is a no-no, even though I don't really understand why. why would socket.io confuse his cookie with someone else's in real time production? what am I missing? how can I make this right?