Skip to content

Commit

Permalink
Properly handle session expiry after POST requests
Browse files Browse the repository at this point in the history
Fixes #11642

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Nov 5, 2015
1 parent 71f86d2 commit fde62aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ phpMyAdmin - ChangeLog
- issue #11633 CodeMirror tooltip shows below modal window
- issue #11639 Bug with the MainBackground Color
- issue Profiling checkbox is missing
- issue #11642 Properly handle session expiry after POST requests

4.5.1.0 (2015-10-23)
- issue Invalid argument supplied for foreach()
Expand Down
6 changes: 5 additions & 1 deletion js/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,11 @@ var AJAX = {
AJAX.xhr = null;
if (parseInt(data.redirect_flag) == 1) {
// add one more GET param to display session expiry msg
window.location.href += '&session_expired=1';
if (window.location.href.indexOf('?') === -1) {
window.location.href += '?session_expired=1';
} else {
window.location.href += '&session_expired=1';
}
window.location.reload();
} else if (parseInt(data.reload_flag) == 1) {
// remove the token param and reload
Expand Down
6 changes: 5 additions & 1 deletion js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ function loadChildNodes(isNode, $expandElem, callback) {
callback(data);
}
} else if(data.redirect_flag == "1") {
window.location.href += '&session_expired=1';
if (window.location.href.indexOf('?') === -1) {
window.location.href += '?session_expired=1';
} else {
window.location.href += '&session_expired=1';
}
window.location.reload();
} else {
var $throbber = $expandElem.find('img.throbber');
Expand Down

0 comments on commit fde62aa

Please sign in to comment.