Jump to content

unsset post value on browser back click


art15

Recommended Posts

Hi All,

 

I have a script which does a logout from the logged on screen when a user clicks on logout. the screen destroys the session and unssets the session and redirect him to login screen where he needs to type user name and password.

 

now if some one clicks on logout it redirects him to login screen, but at the same time if some one clicks back on browser, it will ask for a post message and if user clicks ok it will get him logged in. How do I get rid of that? in a way if some one clicks on browser back he should see the logged on screen?

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/107376-unsset-post-value-on-browser-back-click/
Share on other sites

Unfortunately, this is a browser behavior and is out of your control.

 

The best solution I know of that will work for all browsers/settings is to have a form submit to an intermediate page and then have that page save any $_POST/$_GET variables in a session and then redirect to the actual form processing page.

 

If you do this, the final page (that was redirected to) is not the same URL as the action="..." parameter in the form and the browser won't attempt to resubmit the form data when you click on the back button.

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.