class ContextListener implements ListenerInterface

ContextListener manages the SecurityContext persistence through a session.

Traits

LegacyListenerTrait deprecated

Methods

handle(GetResponseEvent $event) deprecated

No description

__construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null)

No description

getResponse()

No description

setResponse(Response $response)

No description

hasResponse()

No description

setLogoutOnUserChange(bool $logoutOnUserChange) deprecated

Enables deauthentication during refreshUser when the user has changed.

__invoke(RequestEvent $event)

Reads the Security Token from the session.

onKernelResponse(FilterResponseEvent $event)

Writes the security token into the session.

refreshUser(TokenInterface $token)

Refreshes the user by reloading it from the user provider.

static 
handleUnserializeCallback($class)

No description

Details

in LegacyListenerTrait at line 27
handle(GetResponseEvent $event) deprecated

deprecated since Symfony 4.3, use __invoke() instead

Parameters

GetResponseEvent $event

at line 55
__construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null)

Parameters

TokenStorageInterface $tokenStorage
iterable $userProviders
string $contextKey
LoggerInterface $logger
EventDispatcherInterface $dispatcher
AuthenticationTrustResolverInterface $trustResolver

in LegacyListenerTrait at line 41
getResponse()

in LegacyListenerTrait at line 46
setResponse(Response $response)

Parameters

Response $response

in LegacyListenerTrait at line 51
hasResponse()

at line 76
setLogoutOnUserChange(bool $logoutOnUserChange) deprecated

deprecated since Symfony 4.1

Enables deauthentication during refreshUser when the user has changed.

Parameters

bool $logoutOnUserChange

at line 84
__invoke(RequestEvent $event)

Reads the Security Token from the session.

Parameters

RequestEvent $event

at line 125
onKernelResponse(FilterResponseEvent $event)

Writes the security token into the session.

Parameters

FilterResponseEvent $event

at line 161
protected TokenInterface|null refreshUser(TokenInterface $token)

Refreshes the user by reloading it from the user provider.

Parameters

TokenInterface $token

Return Value

TokenInterface|null

Exceptions

RuntimeException

at line 271
static handleUnserializeCallback($class)

Parameters

$class