![]() |
Prevent returning back after logout - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Prevent returning back after logout (/showthread.php?tid=21575) Pages:
1
2
|
Prevent returning back after logout - El Forum - 08-13-2009 [eluser]jbtx[/eluser] ah hi guyz, I need help I had been working on my project using CI for about 2 weeks and its only now that i discover this problem after log-in i get redirected from the login page to the content pages then log-out, the problem is when i press the back button, it would show the content page which is wrong because i already logout! i want to know how to prevent it! can someone help me? Prevent returning back after logout - El Forum - 08-13-2009 [eluser]Rick Jolly[/eluser] You need to instruct browsers to not cache your page by setting some headers: Code: $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0"); http://ellislab.com/forums/viewthread/78061/ http://ellislab.com/forums/viewthread/51313/#249938 Prevent returning back after logout - El Forum - 08-27-2009 [eluser]Rajeswar[/eluser] it is not solution ![]() Prevent returning back after logout - El Forum - 08-27-2009 [eluser]louis w[/eluser] I wouldn't really worry about this. Most sites you can access pages if you hit the back button. If you authentication is set up correctly if they tried to do anything on the page after hitting the back button they would be refused because of the fact that they have logged out. Prevent returning back after logout - El Forum - 03-18-2012 [eluser]elevend[/eluser] hi guys.. can anyone help me to prevent returning back after login or logout?? i has tried to use this code: $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0"); $this->output->set_header("Pragma: no-cache"); but it's not work.. thank you . . . Prevent returning back after logout - El Forum - 03-18-2012 [eluser]InsiteFX[/eluser] This is part of the browser's and not recommended! If it is a problem, logout the user, destroy the session and data then redirect them back to your login view! Prevent returning back after logout - El Forum - 03-18-2012 [eluser]skunkbad[/eluser] @elevend, what browser are you using? I've never had this problem, but then my authentication system is probably different than yours. Prevent returning back after logout - El Forum - 03-18-2012 [eluser]jbtx[/eluser] @elevend, try putting this code in your controller's constructor. Still you have to properly check that the user is logged out and won't be able to do anything after it. Code: $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); Prevent returning back after logout - El Forum - 03-19-2012 [eluser]elevend[/eluser] @skunkbad: i'm using firefox 10.0.2, @jbtx: i has been tried that, and i has been checked that, the user is logged out. but it's still not worked. Prevent returning back after logout - El Forum - 03-19-2012 [eluser]jbtx[/eluser] Can you post your code here? because it's working on my end. |