Im using the Session Library of Codeigniter on my Website connected to a MySQL Database. I have my own Library that works with the session wich is created to handel the login check.
Basically when i log in i store that i'm logged in, in the userdata from the session cookie. (then there are other checks to have some sort of security)
$this->session->set_userdata('logged_in','1');
Now as soon as the session id gets refreshed (standard 300 seconds) all my userdata is gone. I cheked in the Database and there the session Id is not getting updated it just creates a new one.
I'm using the Codeigniter 3.0 and im not sure if thats supposed to work like that.
Edit:
my config.php (session stuff)
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
cookie Stuff
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
Basically what happens ist the following thing:
I get the Session with the id 123. I assign the userdata logged_in = 1 to the session. All is saved in the DB. After 5 minutes. (Or the Time defined in the config file)
$config['sess_time_to_update'] = 300;
I get in my Browser a new session with the id 137 without the userdata. The Session 123 with the userdata logged_ind = 1 is still in the database, together with the newly created session 137.
So instead of an update "sess_time_to_update" its more creation of a new session.
config.php
? – CodeGodiesess_expiration
value in yourapplication/config/config.php
file – SolarBear