Merge pull request #2068 from sminnee/cookie-fix

Ensure Cookie::get() will immediately return results.
This commit is contained in:
Sean Harvey 2013-06-06 16:39:52 -07:00
commit 59fb88bec7

View File

@ -110,6 +110,7 @@ class Cookie {
$expiry = $expiry > 0 ? time()+(86400*$expiry) : $expiry; $expiry = $expiry > 0 ? time()+(86400*$expiry) : $expiry;
$path = ($path) ? $path : Director::baseURL(); $path = ($path) ? $path : Director::baseURL();
setcookie($name, $value, $expiry, $path, $domain, $secure, $httpOnly); setcookie($name, $value, $expiry, $path, $domain, $secure, $httpOnly);
$_COOKIE[$name] = $value;
} else { } else {
if(Config::inst()->get('Cookie', 'report_errors')) { if(Config::inst()->get('Cookie', 'report_errors')) {
user_error("Cookie '$name' can't be set. The site started outputting content at line $line in $file", user_error("Cookie '$name' can't be set. The site started outputting content at line $line in $file",