[WebProfilerBundle] Change incorrect check for the stateless
request attribute
#57679
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.
When upgrading our project from 5.4 to 6.4 (yep..we're late) we encountered an "Session was used while the request was declared stateless." exception when opening the profiler. Our
main
firewall setsstateless: true
as its only used for API requests (and the profiler). Debugging to find what caused the session to be initialized I ended up in theProfilerController::searchBarAction
, which gets the session only if the_stateless
attribute istrue
.According to my understanding an the discussion here https://github.com/symfony/symfony/pull/50218/files#r1668401248 this seems to be incorrect.
We only want to use the session if the request is not
stateless
.