views:

203

answers:

2

I am using codeigniter 1.7.2.

In my web app after logging out, on clicking the back button of the browser the page is reloaded in the logged in page.

This issue is occuring on Opera and Safari only. I have disabled cache using meta, but that doesn't help. :(

<meta http-equiv="PRAGMA" content="NO-STORE" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="CACHE-CONTROL" content="NO-STORE" />

Please help..

A: 

Can you show how you disabled cache using meta?

Browsers use a separate caching-mechanism for browser history. Even if you disabled the cache a browser may still store a page for the browser history. The Cache-Control: no-store header should prevent storing pages at all. The best way to send this header is using PHP instead of relying on meta-elements:

header("Cache-Control: no-store");

Also see: What is Cacheable for the difference between Cache-Control: no-cache and Cache-Control: no-store

Update: This doesn't work in Opera, it works at least in Firefox and Chrome.

Robert Ros
but header("Cache-Control: no-store"); is also not working :(
viMaL
Ah, I just tested it and it seems Opera always caches pages used for it's history. More information on the subject: http://stackoverflow.com/questions/2866826/how-do-i-stop-opera-from-caching-a-page
Robert Ros
but still, i didn't get a solution,,,,
viMaL
A: 

Short answer: the only way to prevent Opera from using cache on history navigation (back/forward button) is to serve the page over https with Cache-control: must-revalidate header.

hallvors
We're working on proposals to fix this problem, for example: http://www.ietf.org/id/draft-pettersen-cache-context-05.txtAn actual implementation is probably some time away - pending further discussion of the proposal.
hallvors