SignatureRememberMeHandler
extends AbstractRememberMeHandler
in package
FinalYes
Implements safe remember-me cookies using the {@see SignatureHasher}.
This handler doesn't require a database for the remember-me tokens. However, it cannot invalidate a specific user session, all sessions for that user will be invalidated instead. Use PersistentRememberMeHandler if you need this.
Tags
Table of Contents
Properties
- $logger : mixed
- $options : mixed
- $requestStack : mixed
- $signatureHasher : mixed
- $userProvider : mixed
Methods
- __construct() : mixed
- clearRememberMeCookie() : void
- Clears the remember-me cookie.
- consumeRememberMeCookie() : UserInterface
- Validates the remember-me cookie and returns the associated User.
- createRememberMeCookie() : void
- {@inheritdoc}
- processRememberMe() : void
- Checks if the RememberMeDetails is a valid cookie to login the given User.
- createCookie() : mixed
- Creates the remember-me cookie using the correct configuration.
Properties
$logger
protected
mixed
$logger
$options
protected
mixed
$options
$requestStack
protected
mixed
$requestStack
$signatureHasher
private
mixed
$signatureHasher
$userProvider
private
mixed
$userProvider
Methods
__construct()
public
__construct(SignatureHasher $signatureHasher, UserProviderInterface $userProvider, RequestStack $requestStack, array<string|int, mixed> $options[, LoggerInterface $logger = null ]) : mixed
Parameters
- $signatureHasher : SignatureHasher
- $userProvider : UserProviderInterface
- $requestStack : RequestStack
- $options : array<string|int, mixed>
- $logger : LoggerInterface = null
clearRememberMeCookie()
Clears the remember-me cookie.
public
clearRememberMeCookie() : void
consumeRememberMeCookie()
Validates the remember-me cookie and returns the associated User.
public
consumeRememberMeCookie(RememberMeDetails $rememberMeDetails) : UserInterface
Parameters
- $rememberMeDetails : RememberMeDetails
Return values
UserInterfacecreateRememberMeCookie()
{@inheritdoc}
public
createRememberMeCookie(UserInterface $user) : void
Parameters
- $user : UserInterface
processRememberMe()
Checks if the RememberMeDetails is a valid cookie to login the given User.
public
processRememberMe(RememberMeDetails $rememberMeDetails, UserInterface $user) : void
This method should also:
- Create a new remember-me cookie to be sent with the response (using createCookie());
- If you store the token somewhere else (e.g. in a database), invalidate the stored token.
Parameters
- $rememberMeDetails : RememberMeDetails
- $user : UserInterface
createCookie()
Creates the remember-me cookie using the correct configuration.
protected
createCookie(RememberMeDetails|null $rememberMeDetails) : mixed
Parameters
- $rememberMeDetails : RememberMeDetails|null
-
The details for the cookie, or null to clear the remember-me cookie