I am using Codeigniter framework to build a website. I am receiving this error:
Error Number: 1146
Table 'users.ci_sessions' doesn't exist
SELECT `data` FROM `ci_sessions` WHERE `id` = '5e47bcb40c2954bd7329ff3fbcf253007a0563cc'
Filename: libraries/Session/drivers/Session_database_driver.php
Line Number: 166
Here is how session is defined: In config.php:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_table_name'] = 'ci_sessions';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_driver'] = 'database'; // changed from file
$config['sess_save_path'] = 'ci_sessions'; // table name
//$config['sess_save_path'] = sys_get_temp_dir();
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_use_database'] = TRUE;
In autoload.php:
$autoload['libraries'] = array('database','session');
I have read https://ellislab.com/codeigniter/user-guide/libraries/sessions.html and followed all steps to properly access the session. Any suggestion on how to fix above error?