|
93 | 93 | message: parseXMLHttpResponse(data), |
94 | 94 | clickAction: clickAction |
95 | 95 | }); |
96 | | - }, |
97 | | - beforeSend: function(XMLHttpRequest) { |
98 | | - if (g_mySession == $.cookie("JSESSIONID")) { |
99 | | - return true; |
100 | | - } else { |
101 | | - var clickAction = function() { |
102 | | - $('#user-options a').eq(0).trigger('click'); |
103 | | - }; |
104 | | - |
105 | | - if ($('.notification-box:visible').size()) { |
106 | | - $('.notification-box, div.overlay:first').remove(); |
107 | | - } |
108 | | - |
109 | | - cloudStack.dialog.notice({ |
110 | | - message: _l('label.session.expired'), |
111 | | - clickAction: clickAction |
112 | | - }).closest('.ui-dialog').overlay(); |
113 | | - |
114 | | - return false; |
115 | | - } |
116 | 96 | } |
117 | 97 | }); |
118 | 98 |
|
|
137 | 117 | } |
138 | 118 | return cookieValue; |
139 | 119 | }; |
140 | | - g_mySession = $.cookie('JSESSIONID'); |
141 | 120 | g_sessionKey = unBoxCookieValue('sessionKey'); |
142 | 121 | g_role = unBoxCookieValue('role'); |
143 | 122 | g_userid = unBoxCookieValue('userid'); |
|
147 | 126 | g_userfullname = unBoxCookieValue('userfullname'); |
148 | 127 | g_timezone = unBoxCookieValue('timezone'); |
149 | 128 | } else { //single-sign-on (bypass login screen) |
150 | | - g_mySession = $.cookie('JSESSIONID'); |
151 | 129 | g_sessionKey = encodeURIComponent(g_loginResponse.sessionkey); |
152 | 130 | g_role = g_loginResponse.type; |
153 | 131 | g_username = g_loginResponse.username; |
|
238 | 216 | async: false, |
239 | 217 | success: function(json) { |
240 | 218 | var loginresponse = json.loginresponse; |
241 | | - |
242 | | - g_mySession = $.cookie('JSESSIONID'); |
| 219 | + |
243 | 220 | g_sessionKey = encodeURIComponent(loginresponse.sessionkey); |
244 | 221 | g_role = loginresponse.type; |
245 | 222 | g_username = loginresponse.username; |
|
335 | 312 | $.ajax({ |
336 | 313 | url: createURL('logout'), |
337 | 314 | async: false, |
338 | | - success: function() { |
339 | | - g_mySession = null; |
| 315 | + success: function() { |
340 | 316 | g_sessionKey = null; |
341 | 317 | g_username = null; |
342 | 318 | g_account = null; |
|
347 | 323 | g_kvmsnapshotenabled = null; |
348 | 324 | g_regionsecondaryenabled = null; |
349 | 325 | g_loginCmdText = null; |
350 | | - |
351 | | - $.cookie('JSESSIONID', null); |
| 326 | + |
352 | 327 | $.cookie('sessionKey', null); |
353 | 328 | $.cookie('username', null); |
354 | 329 | $.cookie('account', null); |
|
0 commit comments