More info:
When session gets regenerated, in MY_Session sess_regenerate function, it saves the old session asĀ $this->pre_regenerated_session_id and the new current session as $this->regenerated_session_id.
I had the script make logs of every step, this is what came out:
DOING LOGIN, login is made, page is shown
OK
Code:
DEBUG - 2017-05-17 20:34:29 --> pre_regenerated_session_id:iijge1q335sdpqb6u7516isvr7porj3k
DEBUG - 2017-05-17 20:34:29 --> regenerated_session_id:85ldb11gpif6vvsh4mv07sfd4a6jopnl
DEBUG - 2017-05-17 20:34:29 --> Test MX_Controller Initialized
DEBUG - 2017-05-17 20:34:29 --> Encryption: Auto-configured driver 'openssl'.
DEBUG - 2017-05-17 20:34:29 --> regenerated_session_id Auth Model (check_login_status) is checking for :85ldb11gpif6vvsh4mv07sfd4a6jopnl
DEBUG - 2017-05-17 20:34:29 --> query: SELECT `u`.`username`, `u`.`email`, `u`.`auth_level`, `u`.`user_id`, `u`.`banned`
FROM `auth_users` `u`
JOIN `auth_sessions` `s` ON `u`.`user_id` = `s`.`user_id`
WHERE `s`.`user_id` = '2205615491'
AND `s`.`login_time` = '2017-05-17 20:34:22'
AND `s`.`id` = 'iijge1q335sdpqb6u7516isvr7porj3k'
LIMIT 1
DEBUG - 2017-05-17 20:34:29 --> ****ROWS******:1
I have my sess_time_to_update set in 5 secs, to speed things up and see where it blows
Log after refreshing page in 5 secs
I GET KICKED OUT
Code:
DEBUG - 2017-05-17 20:34:29 --> File loaded: ../modules/test_1/controllers/Test_1.php
DEBUG - 2017-05-17 20:34:29 --> Test_1 MX_Controller Initialized
DEBUG - 2017-05-17 20:34:29 --> regenerated_session_id auth model (check_login_status) is checking for null:85ldb11gpif6vvsh4mv07sfd4a6jopnl
DEBUG - 2017-05-17 20:34:29 --> query:SELECT `u`.`username`, `u`.`email`, `u`.`auth_level`, `u`.`user_id`, `u`.`banned`
FROM `auth_users` `u`
JOIN `auth_sessions` `s` ON `u`.`user_id` = `s`.`user_id`
WHERE `s`.`user_id` = '2205615491'
AND `s`.`login_time` = '2017-05-17 20:34:22'
AND `s`.`id` = 'iijge1q335sdpqb6u7516isvr7porj3k'
LIMIT 1
DEBUG - 2017-05-17 20:34:29 --> ****ROWS******:0
What I found is that codeigniter is looking for the old session, but my database already has the new one. This is something I dont understand.
Something happened in the middle that I'm missing?
I'll keep looking, any help is appreciated