Closed
Description
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