Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser Cache issue in codeigniter

I am new in code igniter.I created a login form and a logout section. When i press the logout section, the page will redirect to login section. And when i click the back button in the browser it will show the previous pages.When i click the clear recent history and the choose cache,and then press the back button, it will not show the recent pages.It only shows the login section. How to overcome this?Please help me...

like image 862
Nisha haridas Avatar asked Nov 16 '25 05:11

Nisha haridas


1 Answers

In the .htaccess file please add the lines:

<IfModule mod_headers.c>
Header add Cache-Control:  "no-store, no-cache, must-revalidate"
</IfModule>

this .htaccess file should be out side of the application folder. So if you logout your site i.e. if you destroy all the session then no data be stored in the store. So by clicking the back button in the

like image 89
Banshi Avatar answered Nov 18 '25 20:11

Banshi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!