after unset the session or log out. I cant log in another session.
this is my session set
if($check){
$arr = array(
'username' => $username,
'password' => $password
);
$this->session->set_userdata("check",$arr);
}else{
echo "nothing";
return FALSE;
}
and this is my unsetting the session
public function unset_sesssion_data(){
//removing session data
$this->session->unset_userdata('username');
$this->session->unset_userdata('password');
redirect('/log_in', 'refresh');
}
and in my HTML this my code
if($this->session->userdata('username') == TRUE){
echo "WELCOME ".$this->session->userdata('username');
}else{
echo "Please Log In";
}
for logging out
<a href="/log_in/unset_session_data">Log Out</a>
any idea where did I get wrong and I cant set another session to log in another user
edited
I get the correct answer I just remove the check in $this->session->set_userdata("check",$arr);
but why does not make a new set of session?