I put simple php condition in the header.php of template as this : setcookie("test_time_".$cookie_id."", $cookies_times, time()+3600); The result always as this headers already sent , i use this ...
I'm doing a bit of language detection that first checks the $_SERVER['HTTP_ACCEPT_LANGUAGE']. If the user wants to override the choice of language, there's a select list, where they can choose ...
What's a surefire way to check/set cookies before the php headers are sent? Is there an action or filter that would be the best place to hook a setcookie() function?