i am new to codeigniter. i am setting the session in one controller. and i could access that session data from some functions of another controller. but only some functions cannot access the session data. please help me why this is happening.
i set the session by
$admin_details=array(
'admin_id'=>$admin_id,
'admin_name'=>$admin_name,
'email'=>$email,
'is_admin_logged_in'=>true,
'user_type'=>'admin'
);
$this->session->set_userdata($admin_details);
and i accessed it by
function manage_profile()
{
if(!$this->session->userdata('is_admin_logged_in'))
{
$this->load->view('admin/test');
}
}
but it is loading the view 'test'. i have loaded the session library and set the encryption key. it works in some other functions in the same controller.