Skip to content

Node.js based forum software built for the modern web

closes #1346

barisusakli4e71c8328c1c
diff --git a/src/socket.io/index.js b/src/socket.io/index.js
index 92f8eb1158..e64ec2bbe1 100644
--- a/src/socket.io/index.js
+++ b/src/socket.io/index.js
@@ -173,6 +173,10 @@ Sockets.init = function(server) {
Sockets.logoutUser = function(uid) {
Sockets.getUserSockets(uid).forEach(function(socket) {
+ if (socket.handshake && socket.handshake.signedCookies && socket.handshake.signedCookies['express.sid']) {
+ db.sessionStore.destroy(socket.handshake.signedCookies['express.sid']);
+ }
+
socket.emit('event:disconnect');
socket.disconnect();
});