Even I was getting this error on one of my projects, where I was trying to upgrade the CodeIgniter V 1.0 to CodeIgniter V 3.0. It took few days for me to figure out the root cause and eventually I ended up with below steps to get rid of “Invalid Session_userdata” error.
Step 1:
$this->load->library('session')
should be replaced as $this->load->driver('session');
Step: 2
Accessing the session userdata array should be as follows,
Access userdata like this $this->session->cookie->userdata[]
insted of $this->session->userdata[]
Step 3:
$this->CI->session->userdata[]
should be replaced as $this->CI->session->cookie->userdata[]
Step 4:
Don't put echo before calling view file (Ex., $this->load->view('some_view_file','');
)
Step 5:
Controllers, Models, Libraries file name should be started with Capital Letter, because it’s case sensitive.
If you want to know more about upgrading to CodeIgniter V 3.0, refer below link:
http://www.codeigniter.com/userguide3/installation/upgrade_300.html