Reputation: 163
I want to use session, so I try to do autoload. In application > config.php, I do $autoload['libraries'] = array('session');
but I got below error
Message: Class 'CI_Driver_Library' not found
Filename: Session/Session.php
Upvotes: 3
Views: 2922
Reputation: 994
file: url/application/config/config.php
CI Verson
less than 3.0
have given cache
and session
as library
functions.
$autoload[
'libraries'
] = array('cache'
,'session'
);$autoload[
'drivers'
] = array();
And for Verson 3.0 and greater
$autoload[
'libraries'
] = array();$autoload[
'drivers'
] = array('cache'
,'session'
);
remove both from library and then simply add it to drivers You might forget it to remove from library
, this causes proper loading after resolving the problem;
Upvotes: 0
Reputation: 59681
If your using Codeigniter 3.0
or higher use this:
$autoload['drivers'] = array('session');
Because the session
is a driver
not a library
after version 3.0!
Under Version 2.1
it's a library
!
Upvotes: 7