Skip to content

Commit 5c5a7ef

Browse files
authored
Merge branch 'master' into enh/retry-logout
2 parents 9fdb342 + c13e822 commit 5c5a7ef

File tree

1 file changed

+6
-4
lines changed
  • services/static-webserver/client/source/class/osparc/utils

1 file changed

+6
-4
lines changed

services/static-webserver/client/source/class/osparc/utils/Utils.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,11 +1033,13 @@ qx.Class.define("osparc.utils.Utils", {
10331033
// Function that creates a unique tabId even for duplicated tabs
10341034
getClientSessionID: function() {
10351035
const getUniqueSessionId = () => {
1036-
const uuid = osparc.utils.Utils.uuidV4();
1036+
// before creating a new one, check if the websocket has it set
1037+
const webSocket = osparc.wrapper.WebSocket.getInstance().getSocket();
1038+
const clientSessionId = webSocket ? webSocket.io.engine.opts.query["client_session_id"] : osparc.utils.Utils.uuidV4();
10371039
// Set window.name. This property is persistent on window reloads, but it doesn't get copied in a duplicated tab
1038-
window.name = uuid;
1039-
sessionStorage.setItem("clientsessionid", uuid);
1040-
return uuid;
1040+
window.name = clientSessionId;
1041+
sessionStorage.setItem("clientsessionid", clientSessionId);
1042+
return clientSessionId;
10411043
};
10421044

10431045
let uniqueSessionId = sessionStorage.getItem("clientsessionid");

0 commit comments

Comments
 (0)