From ffd1de75c6f1ca213f08a21f6d0d4e8694f128b9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 19 Apr 2004 10:08:06 +0000 Subject: [PATCH] fixed the not-always-working patch of 1.26 --- phpgwapi/inc/class.sessions.inc.php | 31 +++++++---------------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/phpgwapi/inc/class.sessions.inc.php b/phpgwapi/inc/class.sessions.inc.php index a0d6008808..63614d0b9a 100644 --- a/phpgwapi/inc/class.sessions.inc.php +++ b/phpgwapi/inc/class.sessions.inc.php @@ -430,32 +430,15 @@ */ function phpgw_set_cookiedomain() { - $dom = $_SERVER['HTTP_HOST']; - if (preg_match("/^(.*):(.*)$/",$dom,$arr)) + $this->cookie_domain = $_SERVER['HTTP_HOST']; + + // remove port from HTTP_HOST + if (preg_match("/^(.*):(.*)$/",$this->cookie_domain,$arr)) { - $dom = $arr[1]; - } - $parts = explode('.',$dom); - if (count($parts) > 2) - { - if (!ereg('[0-9]+',$parts[1])) - { - for($i=0;$icookie_domain .= '.'.$parts[$i]; - } - } - else - { - $this->cookie_domain = ''; - } - } - else - { - $this->cookie_domain = ''; + $this->cookie_domain = $arr[1]; } print_debug('COOKIE_DOMAIN',$this->cookie_domain,'api'); - + $this->set_cookie_params($this->cookie_domain); // for php4 sessions necessary } @@ -472,7 +455,7 @@ { $this->phpgw_set_cookiedomain(); } - setcookie($cookiename,$cookievalue,$cookietime,'/',$this->cookie_domain); + setcookie($cookiename,$cookievalue,$cookietime,'/',$this->cookie_domain); } /**