mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 02:36:16 +01:00
Fixes #5186
On socket.io connection, all clients join a room pertaining to their express session id. We use this room to keep track of any sessions in different browser windows (but the same cookie jar), so if a login/logout occurs, we can throw a session mismatch modal. This room can also be used to emit messages across windows/tabs...
This commit is contained in:
@@ -57,6 +57,7 @@ var ratelimit = require('../middleware/ratelimit');
|
||||
socket.join('online_guests');
|
||||
}
|
||||
|
||||
socket.join('sess_' + socket.request.signedCookies[nconf.get('sessionKey')]);
|
||||
io.sockets.sockets[socket.id].emit('checkSession', socket.uid);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user