CodeIgniter Forums

Full Version: new session id on each page load
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Every time I load/refresh a page CI generates a new session.
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'CIsession';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 7200;
$config['sess_regenerate_destroy'] = FALSE;

I call session library in autoload
$autoload['libraries'] = array('session');

I have a coockiedomain set correctly
$config['cookie_domain']    = "";

It stores the data in my database correctly, but on every page-load generates a new session. There are no errors in Apache nor in CI log. Do you have any ideas where to start? Thank you
Are you on a localhost? Try leaving the cookie domain blank, does it still create new sessions on page load?
Yes, on localhost. And tried blank cookie domain. Same issue.
Make sure to read carefully the documentation on setting up your CI sessions table:

Especially the part about the primary key and "sess_match_ip".