Skip to content

Commit b7b9b09

Browse files
author
Jessica Wang
committed
cloudstack 3.0 new UI - clean up global variable and session cookie when logging out.
1 parent c4e5ce3 commit b7b9b09

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

‎ui/scripts/cloudStack.js‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
data: "command=login" + array1.join("") + "&response=json",
169169
dataType: "json",
170170
async: false,
171-
success: function(json) {
171+
success: function(json) {
172172
var loginresponse = json.loginresponse;
173173

174174
g_mySession = $.cookie('JSESSIONID');
@@ -256,7 +256,27 @@
256256
$.ajax({
257257
url: createURL('logout'),
258258
async: false,
259-
success: function() {
259+
success: function() {
260+
g_mySession = null;
261+
g_sessionKey = null;
262+
g_username = null;
263+
g_account = null;
264+
g_domainid = null;
265+
g_timezoneoffset = null;
266+
g_timezone = null;
267+
g_supportELB = null;
268+
269+
$.cookie('JSESSIONID', null);
270+
$.cookie('sessionKey', null);
271+
$.cookie('username', null);
272+
$.cookie('account', null);
273+
$.cookie('domainid', null);
274+
$.cookie('role', null);
275+
$.cookie('networktype', null);
276+
$.cookie('timezoneoffset', null);
277+
$.cookie('timezone', null);
278+
$.cookie('supportELB', null);
279+
260280
document.location.reload();
261281
},
262282
error: function() {
@@ -310,7 +330,7 @@
310330
});
311331
}
312332
};
313-
333+
314334
// EULA check
315335
$.ajax({
316336
url: 'eula.' + $.cookie('lang') + '.html',

0 commit comments

Comments
 (0)