diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 4786efc48dc..b7101d79c68 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -316,12 +316,15 @@ $.cookie('timezoneoffset', null); $.cookie('timezone', null); $.cookie('supportELB', null); - - onLogoutCallback(); //set g_loginResponse(single-sign-on variable) to null, then bypassLoginCheck() will show login screen. - document.location.reload(); + + if(onLogoutCallback()) { //set g_loginResponse(single-sign-on variable) to null, then bypassLoginCheck() will show login screen. + document.location.reload(); + } }, error: function() { - onLogoutCallback(); //set g_loginResponse(single-sign-on variable) to null, then bypassLoginCheck() will show login screen. + if(onLogoutCallback()) { //set g_loginResponse(single-sign-on variable) to null, then bypassLoginCheck() will show login screen. + document.location.reload(); + } document.location.reload(); }, beforeSend : function(XMLHttpResponse) {