0
votes

My libraries in autoload.php is:

$autoload['libraries'] = 
     array('database','pagination','session','cart','form_validation');

I get this error:

An Error Was Encountered Unable to load the requested class: session

I'm using codeigniter version 3.0.

6
Can you please add error which you are getting. - Mitul
I am getting this error: An Error Was Encountered Unable to load the requested class: session - yuvi
Have you set encryption key ? - Arkar Aung
yes, i fixed it but no solution - yuvi
Try loading it as a driver, if a library is a folder you should call it like a driver. - killstreet

6 Answers

1
votes

Thanks to all,

finally i found a solution,

I loaded this library like this:

$this->load->library('Session/session');

I used it because in codeigniter 3.0 the libraries files of session is located in the path :

System/libraries/Session/Session.php.

Now, it is working...

0
votes

Check encryption key in config/config.php. If not set then set encryption key in config/config.php

0
votes

You must set encryption key in config/config.php before you use session class. As official documentation described, please make sure about that when you choose encryption key,

To take maximum advantage of the encryption algorithm, your key should be 32 characters in length (128 bits). The key should be as random a string as you can concoct, with numbers and uppercase and lowercase letters. Your key should not be a simple text string. In order to be cryptographically secure it needs to be as random as possible.

Hope it will be useful for you.

0
votes

If you are on Unix/Linux, make sure to load your library with capital letters:

$autoload['libraries'] = array('Session');
                                ^

Also setting encryption key is important.

0
votes

Set encryption key in config.php

$config['encryption_key'] = 'your_key';

Key can be anything Hope your problem can be resolved Thnaks

0
votes

I downloaded the latest version of CodeIgniter and only replaced the Session folder from system/libraries with my old folder and it worked without changing any other things.