CodeIgniter Forums

Full Version: Preventing the Browser From Caching [ Help ]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

[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");