From 4e71c8328c1c2f1e3692e83ccc2184e5ec59fc5d Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 7 Apr 2014 17:38:53 -0400 Subject: [PATCH] closes #1346 --- src/socket.io/index.js | 4 ++++ 1 file changed, 4 insertions(+) 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(); });