From 05c22016ee8faba6cb2302515cb587b2338a9d60 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 10 Oct 2015 08:26:40 +1100 Subject: [PATCH] Fix cookies clearing on version change Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/common.inc.php | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f47064a367..5dd6453194 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ phpMyAdmin - ChangeLog - issue #11542 Import parser and backslash - issue #11546 "Visualize GIS data" seems to be broken - issue #11548 Confirm box on "Reset slave" option +- issue Fix cookies clearing on version change 4.5.0.2 (2015-09-25) - issue #11497 Incorrect indexes when exporting diff --git a/libraries/common.inc.php b/libraries/common.inc.php index ea15788d13..e4fc43cd74 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -314,16 +314,17 @@ $GLOBALS['PMA_Config']->enableBc(); * when changing something related to PMA cookies, increment the cookie version */ $pma_cookie_version = 4; -if (isset($_COOKIE) - && (isset($_COOKIE['pmaCookieVer']) - && $_COOKIE['pmaCookieVer'] < $pma_cookie_version) -) { - // delete all cookies - foreach ($_COOKIE as $cookie_name => $tmp) { - $GLOBALS['PMA_Config']->removeCookie($cookie_name); +if (isset($_COOKIE)) { + if (! isset($_COOKIE['pmaCookieVer']) + || $_COOKIE['pmaCookieVer'] != $pma_cookie_version + ) { + // delete all cookies + foreach ($_COOKIE as $cookie_name => $tmp) { + $GLOBALS['PMA_Config']->removeCookie($cookie_name); + } + $_COOKIE = array(); + $GLOBALS['PMA_Config']->setCookie('pmaCookieVer', $pma_cookie_version); } - $_COOKIE = array(); - $GLOBALS['PMA_Config']->setCookie('pmaCookieVer', $pma_cookie_version); }