I am trying to use session for login and logout in my code but my browser saves the data that is being passed and i can access the page directly if i enter the url like this 'localhost/P_Display/user/Dashboard/' i can access this page directly even after logout does this mean that session is not being destroyed completely? here is my code
if($login_data)
{
$user_id = $login_data->id;
$login_data=$this->session->set_userdata(array('user_id'=>$user_id));
// print_r($login_data);
return redirect("user/dashboard/");
}
this is the part that check the user for login..
now for logout
public function logout()
{
$this->session->unset_userdata('user_id');
$this->session->sess_destroy();
return redirect('user','refresh');
}
what can i do to stop the user from accessing anything after logout?