yuvi
yuvi

Reputation: 52

Unable to load the requested class Session in Codeigniter

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.

Upvotes: 0

Views: 14179

Answers (6)

Ram Pratap
Ram Pratap

Reputation: 1

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.

Upvotes: 0

yuvi
yuvi

Reputation: 52

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...

Upvotes: 1

Anam Shah
Anam Shah

Reputation: 319

Set encryption key in config.php

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

Key can be anything Hope your problem can be resolved Thnaks

Upvotes: 0

Niranjan N Raju
Niranjan N Raju

Reputation: 11987

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.

Upvotes: 0

Arkar Aung
Arkar Aung

Reputation: 3584

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.

Upvotes: 0

Arvind Jaiswal
Arvind Jaiswal

Reputation: 442

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

Upvotes: 0

Related Questions