Index: trunk/core/kernel/session/session.php =================================================================== diff -u -r2835 -r2841 --- trunk/core/kernel/session/session.php (.../session.php) (revision 2835) +++ trunk/core/kernel/session/session.php (.../session.php) (revision 2841) @@ -327,8 +327,40 @@ return preg_match($reg, getArrayValue($_SERVER, 'HTTP_REFERER') ) || (defined('IS_POPUP') && IS_POPUP); } + function CheckDuplicateCookies() + { + if (isset($_SERVER['HTTP_COOKIE'])) { + $cookie_str = $_SERVER['HTTP_COOKIE']; + $cookies = explode('; ', $cookie_str); + $all_cookies = array(); + foreach ($cookies as $cookie) { + list($name, $value) = explode('=', $cookie); + if (isset($all_cookies[$name])) { + //double cookie name!!! + $this->RemoveCookie($name); + } + else $all_cookies[$name] = $value; + } + } + } + + function RemoveCookie($name) + { + $path = $_SERVER['PHP_SELF']; + $path_parts = explode('/', $path); + $cur_path = ''; + setcookie($name, false, null, $cur_path); + foreach ($path_parts as $part) { + $cur_path .= $part; + setcookie($name, false, null, $cur_path); + $cur_path .= '/'; + setcookie($name, false, null, $cur_path); + } + } + function CheckIfCookiesAreOn() { + $this->CheckDuplicateCookies(); if ($this->Mode == smGET_ONLY || (defined('INPORTAL_ENV')&&INPORTAL_ENV && defined('ADMIN')&&ADMIN && !$this->Application->GetVar('front')) ) { //we don't need to bother checking if we would not use it