The index.php page of a website I'm designing needs to be frequently updated, so I've put some header functions at the top of the page that prevent browser caching of the HTML. This page is also the login page for the site.
All of the pages on the site that are visited test that $user_id is set as a session variable to make sure the user is logged in.
The problem I'm having is that when, for instance, userA logs out, if the browser back button is pressed a few times userB can get back to the point where userA sent his username and password to login. Because I've used the header functions described above the following message is displayed in the browser when this point is reached via the back button:
When refresh is clicked it produces a dialog box.When the 'retry' button is clicked on that dialog box the POST information that userA originally sent to login is resubmitted and userB gains access to the site.
This is obviously a fairly large security hole. Can anyone help me out?
All of the pages on the site that are visited test that $user_id is set as a session variable to make sure the user is logged in.
The problem I'm having is that when, for instance, userA logs out, if the browser back button is pressed a few times userB can get back to the point where userA sent his username and password to login. Because I've used the header functions described above the following message is displayed in the browser when this point is reached via the back button:
Warning: Page has Expired
The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
To resubmit your information and view this Web page, click the Refresh button.
When refresh is clicked it produces a dialog box.When the 'retry' button is clicked on that dialog box the POST information that userA originally sent to login is resubmitted and userB gains access to the site.
This is obviously a fairly large security hole. Can anyone help me out?