We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Just installed 2.4.1, and am running into an error on a clean install. If I run a dev/build?flush=1, I get:
[User Warning] Cookie 'PastMember' can't be set. The site started outputting was content at line 76 in /Users/tybarho/Sites/sitesprocket24/sapphire/dev/DebugView.php
GET /dev/build
Line 33 in /Users/tybarho/Sites/sitesprocket24/sapphire/core/Cookie.php
Source
24 $path = ($path) ? $path : Director::baseURL();
25
26 // Versions of PHP prior to 5.2 do not support the $httpOnly value
27 if(version_compare(phpversion(), 5.2, '<')) {
28 setcookie($name, $value, $expiry, $path, $domain, $secure);
29 } else {
30 setcookie($name, $value, $expiry, $path, $domain, $secure, $httpOnly);
31 }
32 } else {
33 if(self::$report_errors) user_error("Cookie '$name' can't be set. The site started outputting was content at line $line in $file", E_USER_WARNING);
34 }
35 }
36
37 /**
38 * Get a cookie variable
39 */
Trace
* Cookie 'PastMember' can't be set. The site started outputting was content at line 76 in /Users/tybarho/Sites/sitesprocket24/sapphire/dev/DebugView.php
Line 33 of Cookie.php
* Cookie::set(PastMember,1,90,,,,1)
Line 84 of Controller.php
* Controller->init()
Line 26 of DatabaseAdmin.php
* DatabaseAdmin->init()
Line 136 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 134 of DevelopmentAdmin.php
* DevelopmentAdmin->build(SS_HTTPRequest)
Line 137 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 124 of Director.php
* Director::direct(/dev/build)
Line 127 of main.php
If I clear cookies, the build works. Perhaps it's not checking the cookie correctly? Seems like it might be trying to set a cookie that's already set, without checking to see if it's set. Bleh, I'm a bad developer =)
I can confirm this happens sometimes (I think most of the time on a dev/build after a fresh install).
Adding this to _config.php temporarily solves the problem:
Cookie::set_report_errors(false);
This has been fixed in http://open.silverstripe.org/changeset/108397 and will be in the next micro release.
I created a new thread from this post: http://www.silverstripe.org/upgrading-silverstripe/show/290536