diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-02-05 11:02:25 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-02-05 11:02:25 +0100 |
commit | 94c2e3078ed9fe3d274bc2680d1ed6b5fef38c43 (patch) | |
tree | 99ba0c9c8eeccda6eb1dcf342ef7ddcd3c5ff629 /Tests/Core/Encoder/EncoderFactoryTest.php | |
parent | ad78f5a640b515579db750d4f87dc9169dd4b9e3 (diff) | |
parent | ac536c333f676c6f55336fcfad2cb414a5a7c206 (diff) | |
download | symfony-security-94c2e3078ed9fe3d274bc2680d1ed6b5fef38c43.zip symfony-security-94c2e3078ed9fe3d274bc2680d1ed6b5fef38c43.tar.gz symfony-security-94c2e3078ed9fe3d274bc2680d1ed6b5fef38c43.tar.bz2 |
bug #13466 [Security] Remove ContextListener's onKernelResponse listener as it is used (davedevelopment)
This PR was squashed before being merged into the 2.3 branch (closes #13466).
Discussion
----------
[Security] Remove ContextListener's onKernelResponse listener as it is used
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
The context listeners are specific to a particular firewall, and as such, should not be applied if the current request doesn't match that context listener. To avoid this, the context listener can remove itself from the dispatcher as it is called.
This comes in to affect when two or more firewalls are setup and using the same kernel for multiple requests. Assuming there are two firewalls 'site' and 'admin'
- Request comes in matching 'site' firewall, 'site' ContextListener adds it's onKernelResponse method to the dispatcher
- Succesful auth for 'site'
- ContextListener writes token to session
- Request comes in matching 'admin' firewall, 'admin' ContextListener can't find anything in the session, so nulls the token in the security context
- 'site' ContextListener listens for response, can't find a token in the security context so removes the 'site' token from the session
Commits
-------
380d805 [Security] Remove ContextListener's onKernelResponse listener as it is used
Diffstat (limited to 'Tests/Core/Encoder/EncoderFactoryTest.php')
0 files changed, 0 insertions, 0 deletions