I store few data in session as the following:
$session_data = array(\"uid\" => \"test user\", \"loged_in\" => true);
$this->session->set_userdat
Did you load your session library? $this->load->library('session'); It might be a dumb question but it does not hurt to ask.
What about setting your encryption key? I imagine you would see an error message for that https://www.codeigniter.com/user_guide/libraries/encryption.html
$session_data = array('uid' => 'test user', 'logged_in' => TRUE);
$this->session->set_userdata($session_data);
// modify session
$this->session->set_userdata('uid', 'New user');