So i was making a login with session and i wanted to make one of the menu on header to show the name of the user after loging in, But i seem to have a problem in making the condition in view 
here is my controller

```
<?php 

class Login extends CI_Controller{

    function __construct(){
        parent::__construct();      
        $this->load->model('m_login');

    }

    function index(){
        $this->load->view('header');
        $this->load->view('v_login');
        $this->load->view('footer');
    }

    function auth(){
        $username = $this->input->post('username');
        $password = $this->input->post('password');
        $where = array(
            'username' => $username,
            'password' => md5($password),
            'id' => '1');
        $where1 = array(
            'username' => $username,
            'password' => md5($password));
        $cek = $this->m_login->cek_login("admin",$where)->num_rows();
        $cek1 = $this->m_login->cek_login1("admin",$where1)->num_rows();
        if($cek > 0){
            $data_session = array(
                'nama' => $username,
                'status' => "login_admin"
                );

            $this->session->set_userdata($data_session);
            redirect(base_url("admin"));
        }elseif($cek1 > 0){
            $data_session = array(
                'nama' => $username,
                'status' => "login_user"
                );

            $this->session->set_userdata($data_session);
            redirect(base_url("user"));
        }else{
            echo "Username dan password salah !";
        }
    }

    function logout(){
        $this->session->unset_userdata($data_session);
        $this->session->sess_destroy();
        redirect(base_url("welcome"));
    }
} 

```

and this is my view

```
<?php if($this->session->userdata('login_admin')) 
          { ?>
          <li class="nav-item px-lg-4">
            <a class="nav-link text-uppercase text-expanded" href="">Welcome Admin</a>
          </li> 
          <li class="nav-item px-lg-4">
            <a class="nav-link text-uppercase text-expanded" href="<?php echo base_url('login/logout'); ?>">Logout</a>
          </li> 
          <?php }elseif($this->session->userdata('login_user')) 
          { ?>
          <li class="nav-item px-lg-4">
            <a class="nav-link text-uppercase text-expanded" href="">Hai, <?php echo $this->session->userdata("nama"); ?></a>
          </li>
          <li class="nav-item px-lg-4">
            <a class="nav-link text-uppercase text-expanded" href="<?php echo base_url('login/logout'); ?>">Logout</a>
          </li> 
          <?php
          }else{ ?>
          <li class="nav-item px-lg-4">
            <a class="nav-link text-uppercase text-expanded" href="login">Masuk</a>
          </li>
          <li class="nav-item px-lg-4">
            <a class="nav-link text-uppercase text-expanded" href="login">Daftar</a> 

```

can anybody tell me is there a problem in my controller or is it as i expected in the view and give me a solution ?