Was the php server updated over the weekend? My code is no longer able to set a cookie in a visitors browser! It seems that your PHP server is now sending a header to the browser before I set my header later in my code inside other files. Many of my php files are now broken because of this issue. Just for grins, I verified this behavior with a simple php cookie checker I just wrote, which generates a random number, sets the cookie and then tries to read the cookie.
Here is the simple code in a file named cc.php on my root public-html folder:
============
<?php
$ccheck = rand(10000000, 99999997);
setcookie('ccheck',$ccheck,time() + 86400); // 86400 = 1 day
$ccheck = $_COOKIE['ccheck'];
if ($ccheck == null) { $ccheck = 0; } // If ccheck equals 0 then cookies are NOT enabled
else { $ccheck = 1; } // If ccheck equals 1 then cookies are enabled
?>
============
THIS IS WHAT THE PHP SERVER RETURNS TO ALL OF MY BROWSER ON ALL DEVICES:
Warning: Cannot modify header information - headers already sent by (output started at /home/talk2azs/public_html/cc.php:2) in /home/talk2azs/public_html/cc.php on line 8
As you can see in my simple code, I am not sending a header.
Please look into this and let me know if this can be fixed as soon as possible. Many of my web apps are now broken because of what happened Friday night. Everything was working prior to Saturday morning.
Thanks
Here is the simple code in a file named cc.php on my root public-html folder:
============
<?php
$ccheck = rand(10000000, 99999997);
setcookie('ccheck',$ccheck,time() + 86400); // 86400 = 1 day
$ccheck = $_COOKIE['ccheck'];
if ($ccheck == null) { $ccheck = 0; } // If ccheck equals 0 then cookies are NOT enabled
else { $ccheck = 1; } // If ccheck equals 1 then cookies are enabled
?>
============
THIS IS WHAT THE PHP SERVER RETURNS TO ALL OF MY BROWSER ON ALL DEVICES:
Warning: Cannot modify header information - headers already sent by (output started at /home/talk2azs/public_html/cc.php:2) in /home/talk2azs/public_html/cc.php on line 8
As you can see in my simple code, I am not sending a header.
Please look into this and let me know if this can be fixed as soon as possible. Many of my web apps are now broken because of what happened Friday night. Everything was working prior to Saturday morning.
Thanks