Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Service "security.logout.listener.cookie_clearing.web" must implement interface "Symfony\Component\EventDispatcher\EventSubscriberInterface". #37282

Copy link
Copy link
Closed
@leevigraham

Description

@leevigraham
Issue body actions

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

  1. Create a new skeleton app with the security component
composer create-project symfony/skeleton bug_app
cd bug_app
composer require symfony/security-bundle
  1. 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
  1. Run bin/console cache:clear

Additional context

image

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.