|
105 | 105 | bypassLoginCheck: function(args) { //determine to show or bypass login screen |
106 | 106 | if (g_loginResponse == null) { //show login screen |
107 | 107 | /* |
108 | | - but if this is a 2nd browser window (of the same domain), login screen still won't show because $.cookie('sessionKey') is valid for 2nd browser window (of the same domain) as well. |
109 | | - i.e. calling listCapabilities API with g_sessionKey from $.cookie('sessionKey') will succeed, |
110 | | - then userValid will be set to true, then an user object (instead of "false") will be returned, then login screen will be bypassed. |
111 | | - */ |
| 108 | + * Since we no longer store sessionKey in cookie, opening the |
| 109 | + * 2nd browser window (of the same domain) will show login screen (i.e. user has to |
| 110 | + * enter credentials again) and will cause the 1st browser window session timeout. |
| 111 | + */ |
112 | 112 | var unBoxCookieValue = function (cookieName) { |
113 | 113 | var cookieValue = $.cookie(cookieName); |
114 | 114 | if (cookieValue && cookieValue.length > 2 && cookieValue[0] === '"' && cookieValue[cookieValue.length-1] === '"') { |
|
117 | 117 | } |
118 | 118 | return cookieValue; |
119 | 119 | }; |
120 | | - g_sessionKey = unBoxCookieValue('sessionKey'); |
| 120 | + g_sessionKey = unBoxCookieValue('JSESSIONID'); |
121 | 121 | g_role = unBoxCookieValue('role'); |
122 | 122 | g_userid = unBoxCookieValue('userid'); |
123 | 123 | g_domainid = unBoxCookieValue('domainid'); |
|
226 | 226 | g_timezone = loginresponse.timezone; |
227 | 227 | g_userfullname = loginresponse.firstname + ' ' + loginresponse.lastname; |
228 | 228 |
|
229 | | - $.cookie('sessionKey', g_sessionKey, { |
230 | | - expires: 1 |
231 | | - }); |
232 | 229 | $.cookie('username', g_username, { |
233 | 230 | expires: 1 |
234 | 231 | }); |
|
324 | 321 | g_regionsecondaryenabled = null; |
325 | 322 | g_loginCmdText = null; |
326 | 323 |
|
327 | | - $.cookie('sessionKey', null); |
| 324 | + $.cookie('JSESSIONID', null); |
328 | 325 | $.cookie('username', null); |
329 | 326 | $.cookie('account', null); |
330 | 327 | $.cookie('domainid', null); |
|
347 | 344 | }, |
348 | 345 |
|
349 | 346 | samlLoginAction: function(args) { |
350 | | - $.cookie('sessionKey', null); |
| 347 | + $.cookie('JSESSIONID', null); |
351 | 348 | $.cookie('username', null); |
352 | 349 | $.cookie('account', null); |
353 | 350 | $.cookie('domainid', null); |
|
0 commit comments