在codeigniter中未设置会话后无法设置会话

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?

Try this, to set the user data

if($check){
    $arr = array(
        'username' => $username,
        'password' => $password
    );
    $this->session->set_userdata($arr);
} else {
    echo "nothing";
    return FALSE;
}

and to unset the user data

public function unset_sesssion_data(){
    $this->session->sess_destroy();
    redirect('/log_in', 'refresh');
}