Skip to main content
gamedev.net
🔒 Locked

PHP Cookie Problem

Started by Monder 0 replies 250+ views
Original Post
Monder
Monder
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]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.