Repository navigation
Reinstate working sessions in browser #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,9 +105,9 @@ | |
| bypassLoginCheck: function(args) { //determine to show or bypass login screen | ||
| if (g_loginResponse == null) { //show login screen | ||
| /* | ||
| * Since we no longer store sessionKey in cookie, opening the | ||
| * 2nd browser window (of the same domain) will show login screen (i.e. user has to | ||
| * enter credentials again) and will cause the 1st browser window session timeout. | ||
| * Changing the cookie name to hostname_cookieName allows | ||
| * separate sessions in the same domain to be handled | ||
| * separately without breaking session persistence. | ||
| */ | ||
| var unBoxCookieValue = function (cookieName) { | ||
| var cookieValue = $.cookie(cookieName); | ||
|
|
@@ -117,15 +117,8 @@ | |
| } | ||
| return cookieValue; | ||
| }; | ||
| unBoxCookieValue('sessionkey'); | ||
| // if sessionkey cookie exists use this to set g_sessionKey | ||
| // and destroy sessionkey cookie | ||
| if ($.cookie('sessionkey')) { | ||
| g_sessionKey = $.cookie('sessionkey'); | ||
| $.cookie('sessionkey', null); | ||
| } else { | ||
| g_sessionKey = unBoxCookieValue('JSESSIONID'); | ||
| } | ||
|
|
||
| g_sessionKey = unBoxCookieValue('sessionKey'); | ||
| g_role = unBoxCookieValue('role'); | ||
| g_userid = unBoxCookieValue('userid'); | ||
| g_domainid = unBoxCookieValue('domainid'); | ||
|
|
@@ -328,14 +321,17 @@ | |
| g_kvmsnapshotenabled = null; | ||
| g_regionsecondaryenabled = null; | ||
| g_loginCmdText = null; | ||
| g_userfullname = null; | ||
| g_userid = null; | ||
|
|
||
| $.cookie('JSESSIONID', null); | ||
| $.cookie('sessionkey', null); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm no UI/Javascript expert, but should these include hostname as well? If so, same goes for L351+
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed Erik, thanks for pointing that out. I've updated the PR. On Tue, May 26, 2015 at 11:46 PM, Erik Weber notifications@github.com
|
||
| $.cookie('username', null); | ||
| $.cookie('account', null); | ||
| $.cookie('domainid', null); | ||
| $.cookie('role', null); | ||
| $.cookie('timezone', null); | ||
| $.cookie('userfullname', null); | ||
| $.cookie('userid', null); | ||
|
|
||
| if (onLogoutCallback()) { //onLogoutCallback() will set g_loginResponse(single-sign-on variable) to null, then bypassLoginCheck() will show login screen. | ||
| document.location.reload(); //when onLogoutCallback() returns true, reload the current document. | ||
|
|
@@ -353,7 +349,6 @@ | |
| }, | ||
|
|
||
| samlLoginAction: function(args) { | ||
| $.cookie('JSESSIONID', null); | ||
| $.cookie('sessionkey', null); | ||
| $.cookie('username', null); | ||
| $.cookie('account', null); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original issue was related to security where session key was stored in cookie; the crux of the fix by Jessica was to use the cookie to set the sessionkey on window (g_sessionKey variable) and destroy it so it may not be read later.