PersistentTokenBasedRememberMeServices

class PersistentTokenBasedRememberMeServices extends AbstractRememberMeServices

Concrete implementation of the RememberMeServicesInterface which needs an implementation of TokenProviderInterface for providing remember-me capabilities.

Constants

COOKIE_DELIMITER

Methods

__construct(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null, SecureRandomInterface $secureRandom = null)

Note: The $secureRandom parameter is deprecated since version 2.8 and will be removed in 3.0.

string getRememberMeParameter()

Returns the parameter that is used for checking whether remember-me services have been requested.

from AbstractRememberMeServices
getKey() deprecated from AbstractRememberMeServices
string getSecret() from AbstractRememberMeServices
TokenInterface autoLogin(Request $request)

Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing.

from AbstractRememberMeServices
logout(Request $request, Response $response, TokenInterface $token)

Implementation for LogoutHandlerInterface. Deletes the cookie.

from AbstractRememberMeServices
loginFail(Request $request)

Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails.

from AbstractRememberMeServices
loginSuccess(Request $request, Response $response, TokenInterface $token)

Implementation for RememberMeServicesInterface. This is called when an authentication is successful.

from AbstractRememberMeServices
setTokenProvider(TokenProviderInterface $tokenProvider)

Details

__construct(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null, SecureRandomInterface $secureRandom = null)

Note: The $secureRandom parameter is deprecated since version 2.8 and will be removed in 3.0.

Parameters

array $userProviders
string $secret
string $providerKey
array $options
LoggerInterface $logger
SecureRandomInterface $secureRandom

string getRememberMeParameter()

Returns the parameter that is used for checking whether remember-me services have been requested.

Return Value

string

getKey() deprecated

deprecated

Since version 2.8, to be removed in 3.0. Use getSecret() instead.

string getSecret()

Return Value

string

final TokenInterface autoLogin(Request $request)

Implementation of RememberMeServicesInterface. Detects whether a remember-me cookie was set, decodes it, and hands it to subclasses for further processing.

Parameters

Request $request

Return Value

TokenInterface

Exceptions

CookieTheftException
RuntimeException

logout(Request $request, Response $response, TokenInterface $token)

Implementation for LogoutHandlerInterface. Deletes the cookie.

Parameters

Request $request
Response $response
TokenInterface $token

final loginFail(Request $request)

Implementation for RememberMeServicesInterface. Deletes the cookie when an attempted authentication fails.

Parameters

Request $request

final loginSuccess(Request $request, Response $response, TokenInterface $token)

Implementation for RememberMeServicesInterface. This is called when an authentication is successful.

Parameters

Request $request
Response $response
TokenInterface $token

setTokenProvider(TokenProviderInterface $tokenProvider)

Parameters

TokenProviderInterface $tokenProvider