[14.0][FIX] auth_session_timeout: session does not expire on page refresh #535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We ran into a problem whereby:
This is a regression since #269, because when page is refreshed with F5, it calls
/web
, which is a public route, so it does not trigger the session check but it does trigger session save, which updates the file mtime. When a second HTTP call makes the check takes place, the session is seen as not expired, and this can repeat indefinitely.An earlier incarnation of this bug made us come up with this patch - before this patch, it could happen that
request.env.user
was not filled so the session timeout check was not done, but the session was saved, so the same conundrum could happen.This PR contains:
auth_method != 'user'
, but for the session uid to be the public user. If it's the public user, the session won't expire.@dreispt @lmignon @sbidoul