#108663: Fix edge case for cookie domains (conform to RFC 2109)
parent
5790f43620
commit
e9e4a3a446
|
|
@ -142,7 +142,11 @@ ini_set('url_rewriter.tags', '');
|
||||||
*/
|
*/
|
||||||
if (isset($_SERVER['HTTP_HOST'])) {
|
if (isset($_SERVER['HTTP_HOST'])) {
|
||||||
$domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
|
$domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
|
||||||
|
// Per RFC 2109, cookie domains must contain at least one dot other than the
|
||||||
|
// first. For hosts such as 'localhost', we don't set a cookie domain.
|
||||||
|
if (count(explode('.', $domain)) > 2) {
|
||||||
ini_set('session.cookie_domain', $domain);
|
ini_set('session.cookie_domain', $domain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue