Losing Session Codeigniter

0

Good afternoon everyone, I started an internship and they gave me an ecommerce to move, it has CodeIgniter (I had never moved) and a library called ion auth (for login) but when I log in it sets the session correctly, when I go for the user panel where I need the session to identify the user the session appears as NULL, can someone give me a light?

if ($password === TRUE)
        {
            if ($user->active == 0)
            {
                $this->trigger_events('post_login_unsuccessful');
                $this->set_error('login_unsuccessful_not_active');

                return FALSE;
            }
          //  echo '<pre>';print_r($user);echo'</pre>';
            $this->set_session($user);
            $this->update_last_login($user->id);
            $this->clear_login_attempts($identity);

            if ($remember && $this->config->item('remember_users', 'ion_auth'))
            {
                $this->remember_user($user->id);
            }

            $this->trigger_events(array('post_login', 'post_login_successful'));
            $this->set_message('login_successful');

            return TRUE;
        }

When it enters this code in the controller it appears to $ _SESSION ['user_id'] as NULL

$idUser = $_SESSION['user_id'];
    $qtdPedidos  = count($this->produtoscliente_model->getQtdPedidosCliente($idUser));
    $qtdProdutos = $this->produtoscliente_model->getQtdProdutosCliente($idUser);
    
asked by anonymous 24.09.2018 / 17:35

0 answers