Page 1 of 1

Destroy cookie problem

Posted: Fri Sep 16, 2005 5:39 am
by hame22
Hi Guys,

I have a login facility on my site that includes a "remember me" facility that remembers a users username and password, these details are stored in cookies:

Code: Select all

if ($check)
			{
				$time = time();
				setcookie("fenmanactivities[username]", $username, $time + 3600);
				setcookie("fenmanactivities[password]", $password, $time + 3600);
			}
when a user logouts of the site I want to destroy this cookie and i have used the following code to destroy the username

Code: Select all

if (isset($_COOKIE['fenmanactivities']))
{
	
	$time = time();
	setcookie("fenmanactivities[username]", $_SESSION['valid_user'] , $time - 3600);
	//setcookie("fenmanactivities[password]","" , $time - 3600);
	
	
}

Now this script works fine in IE but does not work at all in firefox!

does anyone have any ideas as to why this happens and any solutions to my sript?

thanks in advanced

Posted: Fri Sep 16, 2005 7:41 am
by feyd

Code: Select all

setcookie('fenmanactivities[username]','',time()-3600*24*30);
remember that the cookie must match the path, domain, and security setting that was sent with the previous cookie.