Session: Configured driver 'files' was not

2019-06-09 01:07发布

问题:

Being beginner in CodeIgniter, was trying to make login application. After doing some session's work,it's unable to load the login page which was getting loaded earlier.

Error is:

An uncaught Exception was encountered

Type: UnexpectedValueException

Message: Session: Configured driver 'files' was not found. Aborting.

Filename: C:\wamp64\www\CodeIgniter-3.0.1\system\libraries\Session\Session.php

回答1:

Following is wrong in your autoload.php

$autoload['drivers'] = array('files'); 

change this as

$autoload['drivers'] = array('session'); 

and now check



回答2:

Take a look at CI documentation. If you are using files driver, you need to set a writable directory as the 'sess_save_path' configuration item. Yours is set to NULL.

Another important thing that you should know, is to make sure that you don’t use a publicly-readable or shared directory for storing your session files. Make sure that only you have access to see the contents of your chosen sess_save_path directory. Otherwise, anybody who can do that, can also steal any of the current sessions (also known as “session fixation” attack).