![]() |
redirect and come back of my navigator - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: redirect and come back of my navigator (/showthread.php?tid=40495) Pages:
1
2
|
redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]MrAmine[/eluser] hello everyone I create a small login form and for the moment it works well I have a small problem with the helper redirect when I login and I click on button (come back) my browser back to the login page with the form even if I have write the condition if(isset($session)){ redirect('homepage'); } it works when I click on F5 (REFRECH) redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]InsiteFX[/eluser] That's because your web browser is caching your web pages! Code: redirect('homepage', 'refresh'); InsiteFX redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]MrAmine[/eluser] still the same problem my code if(isset($session)){ redirect('home','refresh'); } ![]() redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]InsiteFX[/eluser] You can try this, not tested! You need to call the before displaying you view file! Code: $this->output->set_header("HTTP/1.0 200 OK"); InsiteFX redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]MrAmine[/eluser] or I must write this code? before the code of my view ? thx redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]toopay[/eluser] Why you write it '$session' not '$_SESSION'? What if you do that in CI spec, something like... Code: .... redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]MrAmine[/eluser] yes but the problem when i clic on back button of firefox i come back to login form redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]toopay[/eluser] lol. of course you will! Its because it the browser fetch the page from its cache, without interacting with the server at all. redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]MrAmine[/eluser] what is the solution redirect and come back of my navigator - El Forum - 04-10-2011 [eluser]InsiteFX[/eluser] Ok, so now you are saying that you are clicking on the back buttom which means your browser is using the history cache! You need to set your pages to use a no cache header! Here is a quick way to try out but it doe's not work in all broswers. Add this to your head section in your html page: Code: <?php This is because IE Broswers will not see the first one! InsiteFX |