We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socket.handshake.headers
I am using node.js and socket.io. on the client side, I created a socket.io connection and wrote a cookie like this:
var socket = io.connect('http://localhost:3000'); document.cookie="foo=bar"; socket.emit('this', { is: 'test'});
and on the server side, I need to be able to read from that cookie inside a socket.io connection, something like this:
io.sockets.on('connection', function (socket) { socket.on('this', function(reqData){ console.log(socket.handshake.headers); // there is no cookies here! }); }
you can find my complete code, in this gist. any help is appreciated. thanks.
The text was updated successfully, but these errors were encountered:
I think, you should try this:
window.cookie = "foo=bar"; var socket = io.connect('http://localhost:3000'); socket.emit('this', { is: 'test'});
Sorry, something went wrong.
No branches or pull requests
I am using node.js and socket.io. on the client side, I created a socket.io connection and wrote a cookie like this:
and on the server side, I need to be able to read from that cookie inside a socket.io connection, something like this:
you can find my complete code, in this gist.
any help is appreciated. thanks.
The text was updated successfully, but these errors were encountered: