this is bugging me for a week already. Well I just badly needed to clear the cache of the login page after the user successfully logged in and prevent user from viewing the previous page after logging out when the back button is pressed. I tried adding this codes up in my work (both index page and the login page) in codeigniter but still nothing happens
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
as well as this one:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="01 Jan 1970 00:00:00 GMT">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
Im already thinking about an ansynchronous task to run in background to check the session but well I'm not that good in AJAX. Well what I just wanted is to make it as simple as the ruby on rails done using Cache-Control: no-cache
. By the way I also don't have the knowledge on ruby but seeing that code makes me wonder why there is no simple solution like that in codeigniter? Any solution to do the trick for this one?