Welcome Guest, Not a member yet? Register   Sign In
Login and logout session and cache
#1

[eluser]minerbog[/eluser]
I know this isn't really about CI but its a problem I have come apon today and believe it or not google doesn't have the answer OMG!!

Anyway, when I log out of my app, I kill the session data and the session and redirect to the login page. When you hit the back button a cached version of the page is shown (I'm using FF3.6.8). I've tried all the google answers about
Code:
<meta http-equiv="PRAGMA" content="NO-CACHE">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE">

header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
header( 'Pragma: no-cache' );
etc etc, but nothing seems to work.

However, google have managed to do it? :roll: Anyone know how this is done??

Thanks
Gav.
#2

[eluser]mi6crazyheart[/eluser]
I also want to know little bit more about this. Guys, plz show some light if any body have some clear cut idea about this...
#3

[eluser]WanWizard[/eluser]
For pages that I don't want cached, all I do is
Code:
// make sure the page isn't cached
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");

and that seems to work...
#4

[eluser]mi6crazyheart[/eluser]
Wow!!! this piece of code is really working well. Thx WinWizard...
#5

[eluser]minerbog[/eluser]
[quote author="WanWizard" date="1282258213"]For pages that I don't want cached, all I do is
Code:
// make sure the page isn't cached
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");

and that seems to work...[/quote]

Cheers WanWizard, this works a treat :cheese: . But still, I'm one of those really annoying people that is just not satisfied that it works, and want to know why it works!!! Sorry! Confusedmirk:

Whats the difference from my code except the no store addition? What does that do?

Code:
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
header( 'Pragma: no-cache' );
#6

[eluser]WanWizard[/eluser]
See http://www.w3.org/Protocols/rfc2616/rfc2...#sec14.9.2




Theme © iAndrew 2016 - Forum software by © MyBB