Hey all,
I am having a problem with the cookies being available after they have been set. First, I set the cookie. Then I proced to another page and try to get the value of the cookie and I cant. Can you see any problems here that I may have?
$firstName = $_POST['firstName'];
$set = setcookie('Fisrt', $firstName);
if (!$set)
{echo "Cannot set cookie.";}
else { echo "Set the cookie.<br>";}
This returns true (i.e., "Set the cookie."
.
Then I go to the next page and try to access the cookie.
if (!$HTTP_COOKIE_VARS['First'])
{echo "Cannot see the cookie.";}
else {echo $HTTP_COOKIE_VARS['First'];}
I get Cannot see the cookie.
ANy ideas? Thanks.
I am having a problem with the cookies being available after they have been set. First, I set the cookie. Then I proced to another page and try to get the value of the cookie and I cant. Can you see any problems here that I may have?
$firstName = $_POST['firstName'];
$set = setcookie('Fisrt', $firstName);
if (!$set)
{echo "Cannot set cookie.";}
else { echo "Set the cookie.<br>";}
This returns true (i.e., "Set the cookie."
Then I go to the next page and try to access the cookie.
if (!$HTTP_COOKIE_VARS['First'])
{echo "Cannot see the cookie.";}
else {echo $HTTP_COOKIE_VARS['First'];}
I get Cannot see the cookie.
ANy ideas? Thanks.