I recently upgraded the server software to MySQL 5.6 and PHP 5.6 (which seemed to return settings in PHP.ini to default).
All of a sudden the cookies stopped working in the website, yet those for the installed pHpbb forum still work. However I debugged as far as I could, I have two pages exactly the same with the following code, one produces a cookie and the other doesn't, but instead gets the error of headers already been sent on the line of setcookie.
Page 1:
$exp = time() + 604800;
setcookie("uid6", "6678", "$exp");
print_r($_COOKIE);
Page 2:
$exp = time() + 604800;
setcookie("uid7", "6678", "$exp");
print_r($_COOKIE);
I tried changing the quotes and parameters within the function to no result.
I saw one post on this website from someone who suggested one file he had was UTF-8 with BOM, and when he turned it without BOM it worked. I don't know how to determine this because I have not set the encoding for these individual pages, which have the same permissions and no identifiable differences.