diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 1ae623f127..387e3b0a1f 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -285,17 +285,18 @@ $GLOBALS['PMA_Config']->enableBc(); * clean cookies on upgrade * 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); +$pma_cookie_version = 5; +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); }