$ Cookie retention time $ falg user Unique Identifier $ name User name set cookie information function_setcookie ($ name, $ flag, $ time) {{ code ...}}? & Amp; gt; why cannot I delete IE and Firefox? Setcookie (& quot; username & quot;, & quot;, time ()-...
// $ Cookie retention time
// $ Falg user Unique Identifier
// $ Name Username
// Set cookie Information
Function _ setcookie ($ name, $ flag, $ time)
{
Switch ($ time) {case 0: setcookie ('username', $ name); setcookie ('userflag', $ flag); _ alert_location ('login successful ', 'index. php '); break; case 1: setcookie ('username', $ name, time () + 86400); setcookie ('userflag', $ flag, time () + 86400); _ alert_location ('logon successful ', 'index. php'); break; case 2: setcookie ('username', $ name, time () + 604800); setcookie ('userflag', $ flag, time () + 604800); _ alert_location ('logon successful ', 'index. php '); break ;}
}
?>
IE and Firefox cannot be deleted. Why?
Setcookie ("username", "", time ()-1 );
Setcookie ("userflag", "", time ()-1 );
This is not the case.
I have solved it ~ Is the path Problem
Setcookie ("username", "", time ()-1, '/My_Dome % 201.0 /');
It looks like this ~ But it is strange why '/My_Dome % 201.0/' must be added during local debugging. Isn't it? How can I modify the website after it is officially launched?
Even more depressing is that the path under Firefox and iE is different ~
Setcookie ("username", "", time ()-1, '/My_Dome % 201.0/'); // Delete method under Firefox
Setcookie ("userflag", "", time ()-1, '/My_Dome % 201.0 /');
Setcookie ("username", "", time ()-1, '/My_Dome % 8080'); // delete a cookie in IE
Setcookie ("userflag", "", time ()-1, '/My_Dome % 100 ');
How can I solve this problem ~
Reply content:
// $ Cookie retention time
// $ Falg user Unique Identifier
// $ Name Username
// Set cookie Information
Function _ setcookie ($ name, $ flag, $ time)
{
Switch ($ time) {case 0: setcookie ('username', $ name); setcookie ('userflag', $ flag); _ alert_location ('login successful ', 'index. php '); break; case 1: setcookie ('username', $ name, time () + 86400); setcookie ('userflag', $ flag, time () + 86400); _ alert_location ('logon successful ', 'index. php'); break; case 2: setcookie ('username', $ name, time () + 604800); setcookie ('userflag', $ flag, time () + 604800); _ alert_location ('logon successful ', 'index. php '); break ;}
}
?>
IE and Firefox cannot be deleted. Why?
Setcookie ("username", "", time ()-1 );
Setcookie ("userflag", "", time ()-1 );
This is not the case.
I have solved it ~ Is the path Problem
Setcookie ("username", "", time ()-1, '/My_Dome % 201.0 /');
It looks like this ~ But it is strange why '/My_Dome % 201.0/' must be added during local debugging. Isn't it? How can I modify the website after it is officially launched?
Even more depressing is that the path under Firefox and iE is different ~
Setcookie ("username", "", time ()-1, '/My_Dome % 201.0/'); // Delete method under Firefox
Setcookie ("userflag", "", time ()-1, '/My_Dome % 201.0 /');
Setcookie ("username", "", time ()-1, '/My_Dome % 8080'); // delete a cookie in IE
Setcookie ("userflag", "", time ()-1, '/My_Dome % 100 ');
How can I solve this problem ~
Check whether the path and domain are wrong.