Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookies...

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Can someone please tell me why this is not working! I want the cookie to be set as a browser session one, but for some reason the HTTP_COOKIE_VARS variables wont work and show up :(

Anyone?

$cookie_time = time() + 60 * 60;
setcookie("TEMPCOOKIE", $GLOBALS[admin_password_sent], $cookie_time);

echo $HTTP_COOKIE_VARS["TEMPCOOKIE"];

echo &quot;Password saved... <BR><BR>&quot;;

Thanks

Andy
 
Isn't it that cookies are active after a refresh?
So you set a cookie, you go to another page and the cookies are available?

And is the global[admin_password_sent] available? mcvdmvs
-- &quot;It never hurts to help&quot; -- Eek the Cat
 
Welp, still not working. I tried setting the cookie in a different page, and then referencing it in another script with echo $HTTP_COOKIE_VARS[&quot;TEMPCOOKIE&quot;];, but it just returns a blank :(

Anyone got any ideas?

Thanks

Andy
 
Lol...never mind. Forgot to set it as a Global, so in effect it was meant to be printing nothing :p

Thanks

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top