CodeIgniter Forums
How to reload a page when "back" button is clicked? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to reload a page when "back" button is clicked? (/showthread.php?tid=53355)



How to reload a page when "back" button is clicked? - El Forum - 07-20-2012

[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?


How to reload a page when "back" button is clicked? - El Forum - 07-20-2012

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

jQuery History Plugin