Making guid somewhat more unique, and not using connection, but cookie instead

This commit is contained in:
Kasper Rynning-Tønnesen
2018-08-28 14:46:39 +02:00
parent 6e09c6d59f
commit 8e9a76eb48
2 changed files with 4 additions and 2 deletions

View File

@@ -31,7 +31,9 @@ module.exports = function() {
socket.zoff_id = socket.id;
socket.emit("get_list");
var guid = Functions.hash_pass(socket.handshake.headers["user-agent"] + socket.handshake.address + socket.handshake.headers["accept-language"]);
var guid = socket.cookie_id;
if(guid == "empty") guid = Functions.hash_pass(socket.handshake.headers["user-agent"] + socket.handshake.address + socket.handshake.headers["accept-language"]);
socket.guid = guid;
socket.on('close', function() {
});