From 76f1e7c69cf4bb957e615ea2c1a05d45d7d3fb26 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 14 Sep 2020 16:20:53 +0530 Subject: [PATCH] ui: call logout before login to clear old sessionkey cookies This handle edge cases of upgrades and when legacy UI is used along with Primate or any UI sharing cookies. The specific case it fixes involves removal of duplicate sessionkey cookies. Signed-off-by: Rohit Yadav --- ui/scripts/cloudStack.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index e6550b730746..9e01271fc137 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -280,6 +280,15 @@ var loginCmdText = array1.join(""); + // Logout before login is called to purge any duplicate sessionkey cookies + // to handle edge cases around upgrades and using legacy UI with Primate + $.ajax({ + url: createURL('logout'), + async: false, + success: function() {}, + error: function() {} + }); + $.ajax({ type: "POST", data: "command=login" + loginCmdText + "&response=json",