cookietest1.php
Code: Select all
<?php
setcookie("testcookie", "testvalue");
?>
<a href="cookietest2.php">click</a>Code: Select all
<?php
print ($_COOKIE["testcookie"]);
?>Basically what I've done is created cookietest1.php to set the cookie, then it has a link to cookietest2.php which reads the cookie. The output from cookietest2.php is just blank - as if the cookie had never been set. No errors or anything.
Is there something here I'm doing wrong, or is just my unlucky day?
Thanks
- Tim