Jump to content

[SOLVED] Are PHP Cookies Deleted Different in FireFox


phpQuestioner

Recommended Posts

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.

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.....

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.