Welcome Guest, Not a member yet? Register   Sign In
Problem Deleting Cookie
#2

[eluser]thinkigniter[/eluser]
Direct from php site

Quote:Here is problem I ran into during a recent bout with IE7 and cookies. IE will not delete a cookie value if the time is set to the past. It will hold the value no matter how far in the past you set the "expire" value. IE7 is the only browser I have had problems with - so here is the solution I came up with.
Code:
<?PHP

//check to see how to set the cookie
$Browsertype = $_SERVER['HTTP_USER_AGENT'];
$Parts = explode(" ",$Browsertype);
$MSIE = array_search("MSIE",$Parts);
                
if($MSIE)
{
setcookie("name", "", time()+20000);
}
else
{
setcookie("name", "", time()-20000, "/", ".domain.com" );
}

?>

Give it a try


Messages In This Thread
Problem Deleting Cookie - by El Forum - 12-17-2008, 02:58 PM
Problem Deleting Cookie - by El Forum - 12-17-2008, 04:32 PM
Problem Deleting Cookie - by El Forum - 12-17-2008, 08:39 PM
Problem Deleting Cookie - by El Forum - 12-17-2008, 09:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB