Skip to content

Commit

Permalink
Increase cookie version and improve cookie clearing
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
  • Loading branch information
madhuracj committed Oct 8, 2015
1 parent bf22e3c commit 2087127
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions libraries/common.inc.php
Expand Up @@ -286,17 +286,18 @@
* 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);
}


Expand Down

0 comments on commit 2087127

Please sign in to comment.