I am trying to create a codeigniter login / logout page. My problem is that when I exit the webpage, they redirect me to the login page. When I return, I get a page that says:
Document Validity
This document is no longer available.
But when I refresh this page, I get into the system again (oO)
The following codes contain my constructors and exit functions. Please help me create the perfect login page.
function __construct() { parent::__construct(); $this->load->model('user_model'); $this->output->set_header('Last-Modified: ' . gmdate("D, d MYH:i:s") . ' GMT'); $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); } function logout() { $newdata = array( 'user_name' =>'', 'user_email' => '', 'logged_in' => FALSE, ); $this->session->unset_userdata($newdata); $this->session->sess_destroy(); redirect('default_controller','refresh'); }
I tried to find the correct exit method, but I canβt.
source share