Codeigniter creating a new session every time the page loads

I used codeigniter 2.1.0 for development and for an e-commerce site for a client. The site works well for about 3 months, and then suddenly logins do not stick, session data is not installed. I checked the database and noticed that every time the page loads, a new session is created.

Here is my configuration value

$config['sess_cookie_name']     = 'myu';
$config['sess_expiration']      = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']      = '_sessions';
$config['sess_match_ip']        = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 3600;

$config['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']      = "/";
$config['cookie_secure']    = FALSE;

I edited the user_agent field in the session table to accommodate the long lines of user_agent. What could be the problem? I will be grateful for any help

+5
source share
3 answers

Make sure you have the correct domain set /application/config/config.phpto$config['cookie_domain']

+3
source

"user_agent" . "varchar (40)", Firefox MacOS ( , 20.0) 60 .

"varchar (40)" "varchar (255)" .

+1

, . , , 2 . .

, cookie. $config['sess_encrypt_cookie'] = FALSE; config.php, cookie. $config['sess_cookie_name'] -. "" . . , cookie , , , . , , , cookie . , (, , ['cookie_domain] , ( 2 ) ..), config.php:

$config['sess_cookie_name']     = 'easyeverydayenglish';
$config['sess_expiration']      = 14400;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']      = 'ci_sessions';
$config['sess_match_ip']        = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 300;

$config['cookie_prefix']    = "";
$config['cookie_domain']    = ".eee.loc";
$config['cookie_path']      = "/";
$config['cookie_secure']    = FALSE;

Now about my next problem, trying to get CI to work on goDaddy. Arghh.

0
source

All Articles