I am using Codeigniter 2 and would like to track the number of current users on a site into the database. I know this can be achieved using the built-in session class but I am unsure of what I am doing wrong – I’ve created the ci_sessions table in MySQL and set the following in the config – do I need to make any other adjustments to auto record sessions into the database when someone visits the site?
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
model
controller