Answer the question
In order to leave comments, you need to log in
Why sessions are not saved in the database?
The problem is: when specifying in application/config/config.php, saving sessions in files, everything works, sessions are created.
When specifying in the same file to save sessions in the database, an An uncaught Exception was encountered error appears. What could be the problem if I connect without errors and display data from the database, and also created a table for documentation sessions?
CREATE TABLE IF NOT EXISTS `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(120) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id),
KEY `last_activity_idx` (`last_activity`)
);
$config['encryption_key'] = '';
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = true;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = true;
$config['cookie_prefix'] = '_My';
$config['cookie_domain'] = 'http://www.citest.ru';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question