CodeIgniter Forums
Sessions, Login & Timeouts - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Sessions, Login & Timeouts (/showthread.php?tid=60931)

Sessions, Login & Timeouts - El Forum - 08-04-2014

So I've googled this a fair bit and not having much luck.

The difficulty I'm having is the fact that codeigniter keeps creating new session id's every 5 minutes (as by design apparently). I know I can change the sess_time_to_update to a long period of time but this feels like a hack way of dealing with the situation.

Before I begin, I'm using a database for sessions.

My logic is as follows;

A user logins, in.
I store the session_id against the user in the user table.
I have a controller that checks to see whether a user is logged in on various pages.
This queries the user table for a matching session_id, of which after 5 minutes there is not.

How can I update my user table with the new session_id once codeigniter creates one ?

I've also been having issues implementing a remember me cookie, but I'll come to that once I've resolved this.

In case its needed;
$config['sess_cookie_name']  = 'ci_session';
$config['sess_expiration']  = 7200; // 2 hours
$config['sess_expire_on_close']         = FALSE;
$config['sess_encrypt_cookie']          = TRUE;
$config['sess_use_database']            = TRUE;
$config['sess_table_name']  = 'ci_session';
$config['sess_match_ip']  = TRUE;
$config['sess_match_useragent']         = TRUE;
$config['sess_time_to_update']          = 300; // 5 minutes

Sessions, Login & Timeouts - El Forum - 08-04-2014

Seems I've made some incorrect statements here.. Can't see an option to delete the thread for the time being?