Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug symfony#44618 [HttpKernel] Fix SessionListener without session in…
… request (shyim) This PR was merged into the 5.3 branch. Discussion ---------- [HttpKernel] Fix SessionListener without session in request | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | We have in our project a Listener for `kernel.request` which sets a Response object if it's a `OPTIONS` call. A `setResponse` in the event does stopping all other listeners also the session listener. As the session listener is not triggered in the kernel.request the followup kernel.response event will let the session listener crash. https://github.com/symfony/symfony/blob/5.3/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php#L80 This line tries to get the session from the container, if its missing it calls `getSession` this throws then a error Session is not set. It looks like this issue has been fixed already in Symfony 6. See https://github.com/symfony/symfony/blob/6.1/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php#L99-L101 Commits ------- 7abddd0 Fix SessionListener without session in request
- Loading branch information