I'm using cookies and mySQL, but no sessions to check if a user is logged in. Everything works the way I want it. The problem arises when a user logs out, then clicks the back button. It just reloads the (I assumed cached) "logged in" page. If you refresh it will update and show that you are not logged in.
Is there any way to tell the browser not to use the cached previous page *after* you logout? Or is there another solution to this?
I did a search and only found people with session problems. And the one post I did find that sort of pertained to this didn't have any responses.
Thanks,
Mike
Logout and back button w/out sessions
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Try:
Code: Select all
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");