Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter creating new session on every page load

I used codeigniter 2.1.0 to develop and e-commerce site for a client. The site has been working well for about 3 months then all of a sudden, logins were not sticking, session data was not being set. I checked the database and noticed a new session was being created on every page load.

Here are my config 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 on session table to accommodate long user_agent strings. What could be the problem? i'll be greatful for any help

like image 951
MrFoh Avatar asked Sep 16 '12 10:09

MrFoh


1 Answers

Make sure you have correct domain set in /application/config/config.php at $config['cookie_domain']

like image 196
Tom Avatar answered Oct 18 '22 11:10

Tom