Saturday, 15 September 2012

php - Unable to load the requested class: Session Codeigniter 3 -


In the Codeigniter, the session library is trying to load it seems that this is clearly correct but does not work . Here is a part of the config file:

  $ config ['sess_driver'] = 'database'; $ Config ['sess_cookie_name'] = 'ci_session'; $ Config ['sess_expiration'] = 7200; $ Config ['sess_save_path'] = null; $ Config ['sess_match_ip'] = Wrong; $ Config ['sess_time_to_update'] = 300;  

Additionally, the encryption key variable has already been set. Apart from this, the CI3 documentation can not give me a way to solve this problem.


I have tried:

  1. set 'sess_save_path' variable '
  2. Check folders permissions
  3. < Li> Check that the table 'ci_sessions' exists
  4. Use the Autoloader class
  5. Capital S

This is a bit weird, But config says:

  / * | -------------------------------------------------- ----------------- | Auto Load Library | -------------------------------------------------- ----------------- | These are the classes located in the system / www folder i or in your application / www folder. | Prototype: | | $ Autoload ['www'] = array ('database', 'email', 'session'); | | You can also specify an optional library name to specify in the controller: | | $ Autoload ['www'] = array ('user_agent' = & gt; 'u'); * /  

And here is the code for an auto-loader:

  // Load www if (isset ($ autoload ['www']) & Amp; amp; count ($ autoload ['www']) & gt; {// Load database driver if (in_array ('database', $ autoload ['www'])) {$ this- & Gt; Database (); $ Autoload ['www'] = Array_Diff ($ autoload ['www'], array ('database')); } // Load all the other www foreach ($ autoload ['www'] as $ item) {$ this- & gt; Library ($ item); }}  

Here is a list of what you should try:

  1. Ensure that you load the session library in autload.php: $ autoload ['library'] = array ('session');

  2. Make sure your encryption key is set to cofing.php: $ config ['encryption_key'] = 'nothing'

  3. Make sure your database table is named ci_sessions and your sess_save_path is set to that name: $ config ['Sess_save_path'] = "ci_sessions"

  4. If you are on Unix / Linux, be sure to load your library with capital letters: $ Autoload ['library'] = array ('session');

  5. If nothing does not work, check that you

Download and install the correct CI3 files.

No comments:

Post a Comment