W3cubDocs

/Symfony 2.8

Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices

class TokenBasedRememberMeServices extends AbstractRememberMeServices

Concrete implementation of the RememberMeServicesInterface providing remember-me capabilities without requiring a TokenProvider.

Constants

COOKIE_DELIMITER

Methods

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

Constructor.

from AbstractRememberMeServices
string getRememberMeParameter()

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

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

Implementation of RememberMeServicesInterface.

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

Implementation for LogoutHandlerInterface.

from AbstractRememberMeServices
loginFail(Request $request)

Implementation for RememberMeServicesInterface.

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

Implementation for RememberMeServicesInterface.

from AbstractRememberMeServices

Details

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

Constructor.

Parameters

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

Exceptions

InvalidArgumentException

public string getRememberMeParameter()

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

Return Value

string

public getKey()

public string getSecret()

Return Value

string

final public TokenInterface|null 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|null

Exceptions

CookieTheftException
RuntimeException

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

Implementation for LogoutHandlerInterface.

Deletes the cookie.

Parameters

Request $request
Response $response
TokenInterface $token

final public loginFail(Request $request)

Implementation for RememberMeServicesInterface.

Deletes the cookie when an attempted authentication fails.

Parameters

Request $request

final public 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 The token that resulted in a successful authentication