Closed
Description
Symfony version(s) affected: 5.1.1
Description
Adding delete_cookies
to a firewall throws and error: Service "security.logout.listener.cookie_clearing.web" must implement interface "Symfony\Component\EventDispatcher\EventSubscriberInterface".
I believe this is becuase vendor/symfony/security-http/Logout/CookieClearingLogoutHandler.php
does not implement EventSubscriberInterface
How to reproduce
Reproduction: https://github.com/leevigraham/symonfy_delete_cookies_bug
- Create a new skeleton app with the security component
composer create-project symfony/skeleton bug_app
cd bug_app
composer require symfony/security-bundle
- Add delete_cookies to the firewall config
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
users_in_memory: { memory: null }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: true
lazy: true
provider: users_in_memory
logout:
delete_cookies:
jwtSig: { path: null, domain: null }
jwtPayload: { path: null, domain: null }
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication
# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true
- Run
bin/console cache:clear
Additional context