abstract class AbstractRememberMeServices implements RememberMeServicesInterface, LogoutHandlerInterface

Base class implementing the RememberMeServicesInterface.

Constants

COOKIE_DELIMITER

Properties

protected $logger
protected $options

Methods

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

No description

string
getRememberMeParameter()

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

getKey() deprecated

No description

string
getSecret()

No description

autoLogin(Request $request)

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

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

Implementation for LogoutHandlerInterface. Deletes the cookie.

loginFail(Request $request)

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

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

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

processAutoLoginCookie(array $cookieParts, Request $request)

Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin().

onLoginFail(Request $request)

No description

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

This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it.

getUserProvider($class)

No description

array
decodeCookie(string $rawCookie)

Decodes the raw cookie value.

string
encodeCookie(array $cookieParts)

Encodes the cookie parts.

cancelCookie(Request $request)

Deletes the remember-me cookie.

bool
isRememberMeRequested(Request $request)

Checks whether remember-me capabilities were requested.

Details

at line 55
__construct(array $userProviders, string $secret, string $providerKey, array $options = array(), LoggerInterface $logger = null)

Parameters

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

Exceptions

InvalidArgumentException

at line 80
string getRememberMeParameter()

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

Return Value

string

at line 88
getKey() deprecated

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

at line 98
string getSecret()

Return Value

string

at line 112
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

at line 160
logout(Request $request, Response $response, TokenInterface $token)

Implementation for LogoutHandlerInterface. Deletes the cookie.

Parameters

Request $request
Response $response
TokenInterface $token

at line 169
final loginFail(Request $request)

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

Parameters

Request $request

at line 179
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

at line 219
abstract protected UserInterface processAutoLoginCookie(array $cookieParts, Request $request)

Subclasses should validate the cookie and do any additional processing that is required. This is called from autoLogin().

Parameters

array $cookieParts
Request $request

Return Value

UserInterface

at line 221
protected onLoginFail(Request $request)

Parameters

Request $request

at line 230
abstract protected onLoginSuccess(Request $request, Response $response, TokenInterface $token)

This is called after a user has been logged in successfully, and has requested remember-me capabilities. The implementation usually sets a cookie and possibly stores a persistent record of it.

Parameters

Request $request
Response $response
TokenInterface $token

at line 232
final protected getUserProvider($class)

Parameters

$class

at line 250
protected array decodeCookie(string $rawCookie)

Decodes the raw cookie value.

Parameters

string $rawCookie

Return Value

array

at line 262
protected string encodeCookie(array $cookieParts)

Encodes the cookie parts.

Parameters

array $cookieParts

Return Value

string

Exceptions

InvalidArgumentException When $cookieParts contain the cookie delimiter. Extending class should either remove or escape it.

at line 276
protected cancelCookie(Request $request)

Deletes the remember-me cookie.

Parameters

Request $request

at line 290
protected bool isRememberMeRequested(Request $request)

Checks whether remember-me capabilities were requested.

Parameters

Request $request

Return Value

bool