fix for cookie domain, when using a proxy which rewrites the host-name

This commit is contained in:
Ralf Becker 2004-07-31 10:10:32 +00:00
parent deb05b2ec1
commit 62f11b8d78

View File

@ -430,7 +430,8 @@
*/
function phpgw_set_cookiedomain()
{
$this->cookie_domain = $_SERVER['HTTP_HOST'];
// Use HTTP_X_FORWARDED_HOST if set, which is the case behind a none-transparent proxy
$this->cookie_domain = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
// remove port from HTTP_HOST
if (preg_match("/^(.*):(.*)$/",$this->cookie_domain,$arr))