From 42ca580997c566c3bb98ff631fac8237ed30afbc Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Mon, 10 Nov 2008 13:01:19 +0000 Subject: [PATCH] IdP Disco: Update delete-cookies page to delete all idpdisco cookies. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@983 44740490-163a-0410-bde0-09ae8108e29a --- www/cleardiscochoices.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/www/cleardiscochoices.php b/www/cleardiscochoices.php index 02f3042f2..03456e4f6 100644 --- a/www/cleardiscochoices.php +++ b/www/cleardiscochoices.php @@ -10,23 +10,13 @@ require_once('_include.php'); $config = SimpleSAML_Configuration::getInstance(); $cookiePath = '/' . $config->getBaseUrl(); -/* List over the cookies we should delete. */ -$deleteCookies = array( - 'idpdisco_saml20_rememberchoice', - 'idpdisco_shib13_rememberchoice', - ); - -error_log(var_export($_COOKIE, TRUE)); - -/* Delete the cookies. */ -foreach($deleteCookies as $cookieName) { - if(!array_key_exists($cookieName, $_COOKIE)) { - /* Cookie doesn't exist. */ +/* We delete all cookies which starts with 'idpdisco_' */ +foreach($_COOKIE as $cookieName => $value) { + if (substr($cookieName, 0, 9) !== 'idpdisco_') { + /* Not a idpdisco cookie. */ continue; } - error_log('Deleting: ' . $cookieName); - /* Delete the cookie. We delete it once without the secure flag and once with the secure flag. This * ensures that the cookie will be deleted in any case. */ -- GitLab