I know how to get the client session id when a user connects.
But I would like to receive it at any time, for example, when a client clicks on something, I would like to know who clicked what session identifier they had.
socket.sessionID does not work, but 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 want the user to join the socket room and also get their sessionID. How could I do this? According to the document, this will be socket.join('room') , but I doubt that socket represents only the connection that I have with the client, and not with other clients. Maybe I just have problems understanding sockets!
Romain braun
source share