Hi.
This is probably a newbie cookie problem:
I got two files
setcookie.php:
<?
setcookie("cook ie1","HELLO WORLD 1",time()+3600) ;
setcookie("cook ie2","HELLO WORLD 2",time()+3600) ;
?>
and showcookie.php:
<?
echo $_COOKIE["cookie1"]."<br>";
echo $_COOKIE["cookie2"]."<br>";
?>
The result of running setcookie.php and then showcookie.php is:
Notice: Undefined index: cookie1 in C:\Apache
Group\Apache2\h tdocs\showcooki e.php on line 5
HELLO WORLD 2.
In other words, only the last cookie has been set. What is wrong? This
example is so simple, but yet I don't understand what is happening.
I'm running PHP 4.2.2/Apache 2.0.39 on Win2000.
Cheers
Kasper
This is probably a newbie cookie problem:
I got two files
setcookie.php:
<?
setcookie("cook ie1","HELLO WORLD 1",time()+3600) ;
setcookie("cook ie2","HELLO WORLD 2",time()+3600) ;
?>
and showcookie.php:
<?
echo $_COOKIE["cookie1"]."<br>";
echo $_COOKIE["cookie2"]."<br>";
?>
The result of running setcookie.php and then showcookie.php is:
Notice: Undefined index: cookie1 in C:\Apache
Group\Apache2\h tdocs\showcooki e.php on line 5
HELLO WORLD 2.
In other words, only the last cookie has been set. What is wrong? This
example is so simple, but yet I don't understand what is happening.
I'm running PHP 4.2.2/Apache 2.0.39 on Win2000.
Cheers
Kasper
Comment