Welcome Guest, Not a member yet? Register   Sign In
How to reload a page when "back" button is clicked?
#1

[eluser]Alhazred[/eluser]
I have a page with a form, when the form is submitted, some files are uploaded and stored inside a folder and another page is shown.

From this second page a user could go back with the browser button, it that case I want to delete the uploaded files (I have their names stored into the session) but that doesn't happen.

At the beginning of the controller I've put a check for a session data which is set when the form is submitted, so if that data is already there when the controller's function is called that means the user came back.
Anyway this doesn't work because the page is not reloaded but taken from the browser's cache.

The meta tags could not be reliable because some browsers could ignore them.
I also thought to put a random number in the query string, but clicking the back button the number will be the same as the previous time, it will not be generated a new one.

How do I force the reload?
#2

[eluser]InsiteFX[/eluser]
The only way to do it is using jQuery javascript.

jQuery History Plugin




Theme © iAndrew 2016 - Forum software by © MyBB