Archived

This topic is now archived and is closed to further replies.

Monder

PHP Cookie Problem

Recommended Posts

Ok I'm writing a simple login system for my site in php but for some reason cookies don't seem to be working. I'm sure I'm doing something. I set the cookie like so
  if(setcookie("HempSession", $SessionID, time( )+100000000000)==true)
{
	echo "Cookies work!!!!!";
}      
When I login it says Cookies work!!!! on the page so setcookie has returned true meaning it should've been set successfully. I then access it like this $SessionID = $_COOKIE['HempSession']; only $SessionID ends up blank and I can't find the cookie in my IE cookies dir (I cleared it out so it would be easy to spot). I've tried using $HTTP_COOKIE_VARS to access it but that didn't help. The problem seems to be that it's not being set in the first place even though it reports back it did. Anyone got any ideas on what's going wrong? [edited by - Monder on April 29, 2003 6:16:23 PM]

Share this post


Link to post
Share on other sites