[5.5] Fix NullSessionDriver due to upstream changes #22314
Merged
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.
This is an attempt to fix #22302 that has started occuring due to upstream changes in the Symfony session (see the issue for a very good detailed explanation of the problem by @acarpio89).
The reason the changes only seems to affect the
NullSessionDriver
is because Laravel actually uses its own implementations of every other driver, and was only using the Symfony Null driver.So this PR just creates our own Null driver, and we no longer rely on Symfony for it.
On a seperate issue - this is not picked up by any framework tests - because the tests all mock the session handler, and never try to actually create a session (from what I can see). I tried to create a failing test to capture this situation, but I cant work out how to do it inside a framework test?
Would be nice to add a test around this if someone can point me in the right direction.