phpQuestioner Posted March 30, 2007 Share Posted March 30, 2007 I have created a basic user login script with log out page as well. I have tryied it in IE and it works fine. But in FireFox (version 2.0.03) I tried it and when I click my log out link and it takes me to the page where I delete my cookie; if I click the back button I am still logged in. Before I had the same problem with IE and then I used a re-validate header and the problem went away, but not with FF. Is there a special way I will need to delete cookies for FF? Here is my set cookie page <?php setcookie ('cllvlglvok', 1, time()+1800); ?> Here is my delete cookie page <?php setcookie("cllvlglvok", "", time()-1800); ?> There is more code to the user login script, but this is the set and delete cookie code I am using. Any one ever seen this problem and/or does any one know how to create a "work around" or "hack" for this? Also, when I click the back button in FF and am still logged in; if I click the "reload" or "refresh" button I am logged out; it is so strange. Quote Link to comment Share on other sites More sharing options...
chronister Posted March 30, 2007 Share Posted March 30, 2007 Try unset($_COOKIE["cllvlglvok"]); Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted March 30, 2007 Author Share Posted March 30, 2007 chronister I tried it like you said - like this <?php setcookie ('cllvlglvok', "", time()-1800); unset($_COOKIE["cllvlglvok"]); ?> still had the same issue in FF; so I tried it like this: <?php //setcookie ('cllvlglvok', "", time()-1800); unset($_COOKIE["cllvlglvok"]); ?> Then this issue got worse; it started having the same issue in IE then. So I tried it just now; like this: <?php unset($_COOKIE["cllvlglvok"]); setcookie ('cllvlglvok', "", time()-1800); ?> But the same problem still was occuring in FF; although IE was normal again. So what to do..... Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted March 30, 2007 Author Share Posted March 30, 2007 Where can I find every PHP HTTP No Cache Header that is in existance; maybe I should try them all. Here is what I am using now: <?php header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); ?> This is the one that the php.net manual uses and says will work. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted March 30, 2007 Author Share Posted March 30, 2007 Well I guess that is exactly what I needed (more no cache headers). I added these headers below and it logs out accurately in IE and FF. <?php header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header('Pragma: no-cache'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', FALSE); ?> Headers are awesome !!!!! Thanks for your help chronister. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.