• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to reload a page when "back" button is clicked?

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?

The only way to do it is using jQuery javascript.

jQuery History Plugin

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.