From aba12686196d6820cf83fefef2f4192a7a9fd939 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Fri, 16 Mar 2007 16:48:40 +0000 Subject: [PATCH] [config] clean cookies on phpMyAdmin upgrade --- libraries/common.lib.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 456cdf83d..26dfb3ca8 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2807,6 +2807,22 @@ if (get_magic_quotes_gpc()) { PMA_arrayWalkRecursive($_REQUEST, 'stripslashes', true); } +/** + * clean cookies on new install or upgrade + * when chaning something with increment the cookie version + */ +$pma_cookie_version = 3; +if (isset($_COOKIE) + && (! isset($_COOKIE['pmaCookieVer']) + || $_COOKIE['pmaCookieVer'] < $pma_cookie_version)) { + // delete all cookies + foreach($_COOKIE as $cookie_name => $tmp) { + PMA_removeCookie($cookie_name); + } + $_COOKIE = array(); + PMA_setCookie('pmaCookieVer', $pma_cookie_version); +} + /** * include deprecated grab_globals only if required */