Question:
How to delete cookies when you click logout in php?
anonymous
2011-11-02 08:47:48 UTC
I am trying to destroy my cookies I have set when the user clicks logout. And It doesn't work is there a simlpe cookie destroy script I could use for it?


Any help would be great!
Three answers:
kademi
2011-11-02 08:57:18 UTC
if you won to DESTROY all of cookies on you computer just type↓

%temp% in a run box (short cut is Windows kye + R key)

then Ctrl kye + A key

then shift key + Delete key

then Enter key to confirm

but cookie monster would't approve
Mdk2
2011-11-02 08:51:00 UTC
setcookie('the name of the cookie that you want to destroy','',time() - 60*24*365);



If you set a negative expire time date the cookie will be not setted and if the cookie was previously setted the above code will delete it.
anonymous
2016-12-10 11:10:08 UTC
One reason, that i will see for this issue is: you're consultation variables that validates your get right of entry to isn't precise initialize on the commencing up of the your login script, then once you attempt to login returned the consultation variable is now initialize thats why no blunders happens in the time of that factor. in the experience that your validation set of rules is a few thing like this: If $first_login==a million{ $person = $session_ID } If $person#$session_ID { echo 'get right of entry to denied' } else{ // proceed with the flow }


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...