I would set a session value in codeigniter
$sess_array = array(
'id' => $row->Login_Id,
'username' => $row->Login_Name,
'postid'=> $row->Fk_Post_Id,
);
$CI->session->set_userdata('logged_in', $sess_array);
Then how to retrieve a particular (say - id) session value . I tried these
$createdby=$this->session->userdata('id');
$createdby=$this->session->userdata($logged_in['id']);
but fails.
Use the array syntax for this. Like,
$this->session->userdata['logged_in']['id'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With