Skip to content

[Security] Adding a Flash Message still not working in Logout Subscriber #47247

@ThomasLandauer

Description

@ThomasLandauer

Symfony version(s) affected

5.4.11

Description

It looks like the problem described in #37292 wasn't solved completely in #37368.

I have a LogoutSubscriber that adds a flash message, and this gets lost.

How to reproduce

LogoutSubscriber:

public static function getSubscribedEvents(): array
{
    return [
        LogoutEvent::class => ['logout', 0],
    ];
}

Workaround: Setting the priority to -1, solves it, as suggested in #37292 (comment)

Possible Solution

If this can't be fixed, I'd come up with a PR for https://symfony.com/doc/5.4/security.html#customizing-logout - something like "Due to Symfony internals, when using an event subscriber to add a flash message, you need to set a negative priority, as shown here:..."

Additional Context

No response

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy