From 27e0736408ff93b8e5f052dcc12623027e9eb776 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 28 Feb 2012 09:56:54 -0800 Subject: [PATCH] cloudstack 3.0 new UI - clean up global variable and session cookie when logging out. [reviewed-by: Brian] --- ui/scripts/cloudStack.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 848665a608e..469b7fdd51d 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -168,7 +168,7 @@ data: "command=login" + array1.join("") + "&response=json", dataType: "json", async: false, - success: function(json) { + success: function(json) { var loginresponse = json.loginresponse; g_mySession = $.cookie('JSESSIONID'); @@ -256,7 +256,27 @@ $.ajax({ url: createURL('logout'), async: false, - success: function() { + success: function() { + g_mySession = null; + g_sessionKey = null; + g_username = null; + g_account = null; + g_domainid = null; + g_timezoneoffset = null; + g_timezone = null; + g_supportELB = null; + + $.cookie('JSESSIONID', null); + $.cookie('sessionKey', null); + $.cookie('username', null); + $.cookie('account', null); + $.cookie('domainid', null); + $.cookie('role', null); + $.cookie('networktype', null); + $.cookie('timezoneoffset', null); + $.cookie('timezone', null); + $.cookie('supportELB', null); + document.location.reload(); }, error: function() { @@ -310,7 +330,7 @@ }); } }; - + // EULA check $.ajax({ url: 'eula.' + $.cookie('lang') + '.html',