Unable to load the requested class Session in Codeigniter

前端 未结 6 757
清酒与你
清酒与你 2021-01-26 07:35

My libraries in autoload.php is:

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


        
相关标签:
6条回答
  • 2021-01-26 07:48

    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 讨论(0)
  • 2021-01-26 07:49

    Set encryption key in config.php

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

    Key can be anything Hope your problem can be resolved Thnaks

    0 讨论(0)
  • 2021-01-26 07:59

    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.

    0 讨论(0)
  • 2021-01-26 08:02

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

    0 讨论(0)
  • 2021-01-26 08:08

    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 讨论(0)
  • 2021-01-26 08:11

    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 讨论(0)
提交回复
热议问题