I started using codeigniter for my project. I have a user authentication system for my site. I saw a video with nettuts to login. I am confused why logging out does not work properly.
I have the following exit function from my login controller.
function logout() { $this->session->sess_destroy(); redirect('main'); }
If I click the Logout button, I will redirect the user to the main page. But after redirecting the user to the main page, if I click on the "Back" button in the browser, I will see the resignation and my name at the top of the page. I need help with where I'm wrong, or is there some important code missing from my controller.
Thanks in advance
EDIT
I think I found a solution. I have to add the following code to the appropriate controller
$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");
php codeigniter logout
user525146
source share