This is similar to #2792305: DigiD doesn't force autologout when browser was closed for a long time.
In this case, when a DigiD user closes a tab then restores it after dvg_digid_autologout_timeout seconds, but still within dvg_digid_autologout_max_session_time, the session will be prolonged with dvg_digid_autologout_timeout seconds, instead of closed.
Attached minimal patch adds a check in init. We cannot use _dvg_digid_autologout_get_user_timeout() for this check as this returns a future timeout which would incorrectly log a user out in the following scenario:
// timeout = 15 minutes, L is last refresh, Q is current request, M is when max session duration is reached:
L--------Q--------M
12 min 10 min
Note that the inactivity message is not correct on exceeding max session time, but that's for another issue.
Comments
Comment #2
askibinski commentedSounds logical. I'll ask Ralph to take a look at this one, he's got more experience with the logout module.
Comment #3
ralphvdhoudt commented@Heine
I'm trying to reproduce it. I changed the dvg_digid_autologout_timeout to 1 minute and dvg_digid_autologout_max_session_time to 90 minutes. When I close the browser and return after 2 minutes but still within the 90 minutes the session is closed correctly. Can you explain the bug a little bit more
Comment #4
heine commented- Are you using RC3?
- Did you set dvg_digid_autlogout_max_session_time to 5400 ?
- I'm just closing tabs, not the browser, because our cookie_lifetime is set to 0.
When I use the values from #3, I can still reproduce. I also see no way how the code would force a logout after expiry as I cannot find a check on idle time since $_SESSION['autologout_last'].
Comment #5
ralphvdhoudt commentedReviewed & committed