I have used a redirect url in my logout function, 1st time logout it works fine but subsequent requests after 1st time logout doesn't reaches logout function , rather it directly calls redirect url and why is it so, any explanation?
public function logout()
{
$this->session->unset_userdata('user');
$this->session->sess_destroy();
redirect(base_url('user/def'));
}
after login session works fine in other pages
public function login(){
if($user->name && $pwd){
$data = array('id'=>$user->id,'username'=> $uname,'loggedin' => TRUE);
$this->session->set_userdata('user',$data);
$this->session->set_userdata($data);
}
}