0

I'm receiving the following error on all pages in a CodeIgniter application.

Invalid driver requested: Session_userdata

Does anyone have any idea what causes this? I don't seem to be able to find any information on this and can't seem to diagnose the issue.

The only thing I know is it's whenever the Session driver is loaded and I use session userdata.

Many thanks

Ryan
  • 3,552
  • 1
  • 22
  • 39

1 Answers1

0

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

Prasad G K
  • 136
  • 1
  • 7