Do not try to keep alive session even after expiry

There is no sense in sending keepalive requests even after potential
session expiry. So limit sending of these only as long we're not idle
over cookie login validity.

Fixes #12550

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-09-16 09:35:08 +02:00
parent 168a419f48
commit 54e3434c0f
2 changed files with 7 additions and 6 deletions

View File

@ -28,6 +28,7 @@ phpMyAdmin - ChangeLog
- issue #11628 Proper parsing of INSERT ... ON DUPLICATE KEY queries
- issue #12545 Proper parsing of CREATE TABLE ... PARTITION queries
- issue #12473 Code can throw unhandled exception
- issue #12550 Do not try to keep alive session even after expiry
4.6.4 (2016-08-16)
- issue [security] Weaknesses with cookie encryption, see PMASA-2016-29

View File

@ -903,13 +903,13 @@ AJAX.registerOnload('functions.js', function () {
data: params,
success: function (data) {
if (data.success) {
if (PMA_commonParams.get('LoginCookieValidity')-_idleSecondsCounter > 5) {
var interval = (PMA_commonParams.get('LoginCookieValidity') - _idleSecondsCounter - 5) * 1000;
if (interval > Math.pow(2, 31) - 1) { // max value for setInterval() function
interval = Math.pow(2, 31) - 1;
}
var remaining = PMA_commonParams.get('LoginCookieValidity') - _idleSecondsCounter;
if (remaining > 5) {
// max value for setInterval() function
var interval = min(remaining * 1000, Math.pow(2, 31) - 1);
updateTimeout = window.setTimeout(UpdateIdleTime, interval);
} else {
} else if (remaining > 0) {
// We're close to session expiry
updateTimeout = window.setTimeout(UpdateIdleTime, 2000);
}
} else { //timeout occurred