Ok, I'm attempting to use a cookie to store a login identity on my site, but not matter what I try I can't get the cookie to set in either IE6 or Mozilla Firebird.
I am currently testing the site on a personal server running Apache and PHP v4.3.3. Even setcookie scripts that I have downloaded directly from the web don't work.
Is there some setting I didn't turn on, or what? The cookie defineition is the first thing in the code, so that shouldn't be a problem.
Here is an example of the code I was trying to use just to test cookies:
<?php
setcookie("vegetable", "artichoke", 3600, "/", "localhost", 0);
?>
<html>
<head>
<title>Listing 15.6 Setting and printing a cookie value</title>
</head>
<body>
<?php
if (isset($COOKIE[vegetable])) {
print "<p>Hello again, your chosen vegetable is $COOKIE[vegetable]</p>";
} else {
print "<p>Hello you. This may be your first visit</p>";
}
?>
</body>
</html>
Any help would be great. Thanks!!