basic set and read a cookie probs
| From: | Jack E. Wasserstein, DDS, Inc. | Date: | Thu, 25 Dec 2003 00:57:07 +0000 |
| Subject: | basic set and read a cookie probs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173312@lists.php.net to get a copy of this message | ||
I am using the following code on the php form handler
if ($_POST[referdrremember] == "true") {
setcookie("remailcookie",
"$_POST_VARS[refdremail]",time()+3600,"/","wasserstein.com","0");
Try to see the cookie in the same script, not sure which one to use with or
without $
print " the cookie's value is $HTTP_COOKIE_VARS[remailcookie] ";
print " the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ";
In addition when I get back to the calling form and refresh it I try to see
the cookie with this:
if ($HTTP_COOKIE_VARS[remailcookie]) {
print ("remail cookie exists"); }
else {
print ("no cookie");
}
This yeilds "no cookie"
I have also tried $_COOKIE[] as well
What am I doing wrong.
Thanks in advance,
Jack