1

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..

viMaL
  • 638
  • 1
  • 7
  • 20

2 Answers2

0

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
  • 1,526
  • 11
  • 22
  • but header("Cache-Control: no-store"); is also not working :( – viMaL Aug 27 '10 at 08:42
  • 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 Aug 27 '10 at 09:23
  • but still, i didn't get a solution,,,, – viMaL Aug 28 '10 at 03:35
0

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
  • 6,069
  • 1
  • 25
  • 43
  • We're working on proposals to fix this problem, for example: http://www.ietf.org/id/draft-pettersen-cache-context-05.txt An actual implementation is probably some time away - pending further discussion of the proposal. – hallvors Sep 03 '10 at 10:13