Click to See Complete Forum and Search --> : IE cache/session vars problem


tripwater
02-23-2004, 01:49 PM
Hello,

I posted this in the php forum, But I want to make sure I am approaching this from the correct angle.

I have a site that is a project tracking system and throughout the site I have session vars that store user login and various choices they have made. I understand I could use cookies but I chose sessions instead.

The problem I am having is only in IE. I can login as a user and look at my tasks, all is fine. I can then hit logout which kills the session and log back in with a new user and password only to see the same information I just left.

If I had 10 tasks for the day and logout, the new user shows 10 tasks even if they only have 3.

When you click on the link however to view these tasks, it shows you the correct info for the logged in user. I have tried making changes in Apache to not cache but this basically logs the user out each time you leave a page. I have other issues with sessions as well with a popup refreshing the parent window but I will get to that maybe later, I am assuming they are related.

If I clear the cache in IE before doing this, it works so It is a cache issue.

Any ideas on how I can handle this? Seeing that most users are using IE this is a problem for me. I have it working perfectly in Mozilla/Galleon/Netscape....IE no.


Thanks for any help.

tripwater
02-23-2004, 03:39 PM
I have run across this problem before and searching for the solution always seemed to be in vain. So here is what worked for me in case anyone else is having this problem


http://www.phpbuilder.com/tips/item.php?id=123

I added this to the top of my pages and everything works great so far.

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0,pre-check=0");
header("Cache-Control: max-age=0");
header("Pragma: no-cache");