[eluser]Maglok[/eluser]
Greetings,
We use CI sessions a lot in our applications. Several of our applications have a 'bug'. If you do not do anything for a while, after logging in, if you click anything your session is gone and the application redirects to the login page.
We have this in several applications, but I will quote two ways of how we handle the sessions. We have looked all over the place and can't seem to find why our session is removed.
Here we go, one traditional config:
Code:
$config['sess_cookie_name'] = 'taakstelling_dev';
$config['sess_expiration'] = 0;
$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'] = 60;
Another one is where we do not autoload the sessionlibrary, only load it in the part of the application we need to login and then set the database to true:
Code:
$config['sess_cookie_name'] = 'studyspot';
$config['sess_expiration'] = 72000;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
I can show you any specific code, but there is nothing that jumps out at us.
Bottom line: Why do we keep losing our sessions?
EDIT: I just realised here is some info, we set the session var 'logged_in' or 'loggedin', depending on what application we are talking about.