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); }