the problem is this, when i login into the project, it creates the session, but when i try to acces the session from other controller, or even from the same controller, the session data doesn't existe, i have loaded session from autoload, and i also tried loading the session in the constructor, but the issue is still there. forgive for my english, this is not my native language, i hope you can help me please, thanks
Controller login function:
public function do_login(){
$user = $this->input->post('usuario');
$passwd = $this->input->post('clave');
$data = $this->login_model->do_login($user,$passwd);
if($data){
$this->session->set_userdata("login",(array)$data);
//print_r($this->session->userdata());
echo json_encode(array('status' => 1,'message'=>'Bienvenido','idPerfil'=> $data->idPerfil));
}else
echo json_encode(array('status' => 0,'message'=>'Usuario o contraseƱa incorrecto'));
}
constructor
public function __construct(){
parent::__construct();
$this->load->model('login_model');
$this->load->library('Mobile_Detect');
//$this->load->model('cat_usuarios_model');
// $this->load->model('cat_sucursales_model');
$this->load->library("session");
}
this is the autoload.php line
$autoload['libraries'] = array('session','database','form_validation','email');