Reset the cookie session before Mojolicious saves it. #2731
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.
Currently the session parameters are set at the beginning of each request. However, if another request occurs for the same process before the first request completes, then the session for the first request gets saved with the parameters of the second request. This is because there is only one Mojoicious session setup for the entire app and the session parameters are global for the process.
To fix this the session parameters need to be set again at the end of the request just before the session is saved.
This is only an issue if there are multiple clients per worker process. Of course that is not the case at this point, but hopefully will be some day, so I am going to go ahead an put this in. This is not critical that it goes into this release, and it can be delayed until after the release.