Good evening guys,
I am using the codeigniter and native session of php $ _SESSION, it happens that I can only use the session when instancio in a login controller that redirects to another page, but if I want to use the information of this session in another page I can not , says qa session does not exist. I already broke my mind already, I tried a little bit of everything but I can not continue with my application without first solving this question, I would like the help of the staff who handle a little more. Thank you all!
controller (this part works fine and the admin view is calm to session the problem and if I want to use the information of this session in other views it does not exist)
public function check_login()
{
$login = $this->input->post('login');
$pass = md5(md5(md5($this->input->post('pass'))));
$user = $this->login_model->checkLogin($login, $pass);
if(!$user)
{
$data['msg_erro'] = "Login ou senha inválido.";
$this->load->view('index', $data);
}
else{
if($user->cod_user == 1)
{
$_SESSION['ci_session'] = $user->name;
$this->load->view('admin');
}
else if($user->cod_user == 2)
{
$_SESSION['vendedor'] = $user->name;
$this->load->view('vendedor');
}
}
}