41
rated 0 times
[
45]
[
4]
/ answers: 1 / hits: 15942
/ 11 Years ago, thu, november 7, 2013, 12:00:00
I know how to retrieve the client sessionID when the user connects.
But I'd like to retrieve it at any time, for example when the client clicks on something, I would like to be able to know who clicked, what their sessionID was.
socket.sessionID
doesn't work, nor does socket.handshake.sessionID
For example :
I have this express route :
.get('/result/:survey', function(req, res) {
res.redirect('/result/'+req.params.survey+'/1');
})
Just before the redirection, I'd like to make the user join a socket room, and also get their sessionID. How could I possibly do that ? According to the doc, it would be socket.join('room')
but I doubt socket
only represents the connection I have with the client, and not with the other clients. Maybe I'm just having trouble understanding sockets !
More From » node.js