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: logout (/showthread.php?tid=32089) |
logout - El Forum - 07-12-2010 [eluser]sree777[/eluser] After logout while i click back button the page goes to last page. function logout() { $this->session->unset_userdata('admin_id'); $this->session->unset_userdata('logged_in'); $this->session->unset_userdata('username'); $this->session->unset_userdata(); $this->session->sess_destroy(); redirect('login/','refresh'); //$this->index(); } The page is refreshing but i can go to the last page i had taken... how can i solve this problem logout - El Forum - 07-13-2010 [eluser]mario simaremare[/eluser] i got the same problem, i've invoked the session->session_destroy() but there are still some session items 'alive'. how to remove all the session while someone logout? logout - El Forum - 07-13-2010 [eluser]mario simaremare[/eluser] well, i create this: function _clear_session(){ $this->_remove_session($this->session->all_userdata()); $this->session->sess_destroy(); } then all sessions are going dead! logout - El Forum - 08-24-2010 [eluser]Unknown[/eluser] your code is fine. don't worry about using the back button of the browser, you can't go anywhere else after that, you are logged out. logout - El Forum - 09-21-2010 [eluser]jbtx[/eluser] try putting this in your controller's constructor Code: $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); logout - El Forum - 03-03-2012 [eluser]Unknown[/eluser] [quote author="dimin" date="1322731899"][quote author="jbtx" date="1285062026"]try putting this in your controller's constructor Code: $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); Great solution, it works... [/quote] hi sir it is great solution but when i put it into constructor of controller this work fine but some time ago every thing is go down. plz help me to repair me site http://glms.microinn.edu.pk/ thanks in advance logout - El Forum - 03-03-2012 [eluser]DaddyBear[/eluser] Hi Google Chrome says the following Quote:The web page at http://glms.microinn.edu.pk/index.php/sessions/login has resulted in too many redirects. In my controller (using CI 2.1.0) I have the following: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Then the usual functions under that, public function index() { etc. Check all your functions though, you might simply have a redirect function that keeps calling itself and creates an infinite loop. Hope this helps. logout - El Forum - 04-04-2012 [eluser]José Neto[/eluser] [quote author="dimin" date="1322731899"][quote author="jbtx" date="1285062026"]try putting this in your controller's constructor Code: $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); Great solution, it works... [/quote] Work fine to me! Thanks logout - El Forum - 08-23-2012 [eluser]DaddyBear[/eluser] Thought I would add one more bit to this. Although Code: $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); Now I only use the following 2 lines and get rid of the must-revalidate bit and it works fine. Code: $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); Hope this helps someone. logout - El Forum - 10-07-2013 [eluser]EdemOne[/eluser] [quote author="PhilTem" date="1326803239"]I don't know exactly how to fix it, but I always use this code for logout-scripts Code: $this->CI->session->sess_destroy(); because sometimes sess_destroy() is enough to safely destroy the session. Calling sess_create() to create a new session with a new session-id and new, blank userdata works better (at least for me it does )[/quote] Thanks it has worked for me. |