CodeIgniter Forums
Preventing the Browser From Caching [ Help ] - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Preventing the Browser From Caching [ Help ] (/thread-7927.html)



Preventing the Browser From Caching [ Help ] - El Forum - 04-28-2008

[eluser]Justin Patel[/eluser]
Hello Friends,

I am working on security issues ..

The problem is Browser Caching ... After logout , if I press back button it display the old content ...

I SHOULD NOT HAPPEN ..... Sad


Any help will be greatly appreciated ...

Thanks,
justin


Preventing the Browser From Caching [ Help ] - El Forum - 04-28-2008

[eluser]Lone[/eluser]
You can't stop the back button from having this action depending on the browser you are using as from memory some browsers (IE6?) don't bother after refreshing content when you click back.

The real test is click back then press refresh and see if the status has changed. Alternatively if you are still having cache issues insert the following into the relevant controller function/method.

Code:
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");