class LogoutListener implements ListenerInterface

LogoutListener logout users.

Methods

__construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, LogoutSuccessHandlerInterface $successHandler, array $options = [], CsrfTokenManagerInterface $csrfTokenManager = null)

No description

addHandler(LogoutHandlerInterface $handler)

No description

handle(GetResponseEvent $event)

Performs the logout if requested.

bool
requiresLogout(Request $request)

Whether this request is asking for logout.

Details

at line 47
__construct(TokenStorageInterface $tokenStorage, HttpUtils $httpUtils, LogoutSuccessHandlerInterface $successHandler, array $options = [], CsrfTokenManagerInterface $csrfTokenManager = null)

Parameters

TokenStorageInterface $tokenStorage
HttpUtils $httpUtils An HttpUtils instance
LogoutSuccessHandlerInterface $successHandler A LogoutSuccessHandlerInterface instance
array $options An array of options to process a logout attempt
CsrfTokenManagerInterface $csrfTokenManager A CsrfTokenManagerInterface instance

at line 61
addHandler(LogoutHandlerInterface $handler)

Parameters

LogoutHandlerInterface $handler

at line 75
handle(GetResponseEvent $event)

Performs the logout if requested.

If a CsrfTokenManagerInterface instance is available, it will be used to validate the request.

Parameters

GetResponseEvent $event

Exceptions

LogoutException if the CSRF token is invalid
RuntimeException if the LogoutSuccessHandlerInterface instance does not return a response

at line 117
protected bool requiresLogout(Request $request)

Whether this request is asking for logout.

The default implementation only processed requests to a specific path, but a subclass could change this to logout requests where certain parameters is present.

Parameters

Request $request

Return Value

bool