setcookie problem
Posted: Fri Apr 23, 2010 11:14 am
Using the following setcookie example from http://php.net/manual/en/function.setcookie.php
I get a warning error.
This is on a local machine using the Rapid PHP 2010 editor and server.
Warning: Cannot modify header information - headers alredy sent by (output started at C:\user\***\AppData\local\temp\prev0-.php:7) in {machine path} on line 4.
So why does their example fail to work?
I get a warning error.
This is on a local machine using the Rapid PHP 2010 editor and server.
Code: Select all
$value = 'something from somewhere';
setcookie("TestCookie", $value);
setcookie("TestCookie", $value, time()+3600); /* expire in 1 hour */
setcookie("TestCookie", $value, time()+3600, "/~rasmus/", ".example.com", 1);
Warning: Cannot modify header information - headers alredy sent by (output started at C:\user\***\AppData\local\temp\prev0-.php:7) in {machine path} on line 4.
So why does their example fail to work?