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

[Security] Logout success_handler is called **before** the actual logout happens #36227

Copy link
Copy link
Closed
@ThomasLandauer

Description

@ThomasLandauer
Issue body actions

Symfony version(s) affected: 4.4.5

Description
Logout success_handler is called before the actual logout happens.

Here's the problem:
https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/LogoutListener.php#L95

The Response is created too early, since the actual logout is only happening below.

Reference at https://symfony.com/doc/4.4/reference/configuration/security.html#success-handler is saying that this is for "handling a successful logout." (Which is also in line with my understanding of a "success handler" and the semantics of onLogoutSuccess.) But this is not the case, cause until it has actually happened, there is no successful logout (but merely a pending logout).

So I'm suggesting to move $this->tokenStorage->setToken(null); https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/LogoutListener.php#L107 above the $response = ... line.

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.