interface RememberMeHandlerInterface

Handles creating and validating remember-me cookies.

If you want to add a custom implementation, you want to extend from {see AbstractRememberMeHandler} instead.

Methods

void
createRememberMeCookie(UserInterface$user)

Creates a remember-me cookie.

consumeRememberMeCookie(RememberMeDetails$rememberMeDetails)

Validates the remember-me cookie and returns the associated User.

void
clearRememberMeCookie()

Clears the remember-me cookie.

Details

void createRememberMeCookie(UserInterface$user)

Creates a remember-me cookie.

The actual cookie should be set as an attribute on the main request, which is transformed into a response cookie by {see ResponseListener}.

Parameters

UserInterface $user

Return Value

void

UserInterface consumeRememberMeCookie(RememberMeDetails$rememberMeDetails)

Validates the remember-me cookie and returns the associated User.

Every cookie should only be used once. This means that this method should also: - Create a new remember-me cookie to be sent with the response (using the {see ResponseListener::COOKIE_ATTR_NAME} request attribute); - If you store the token somewhere else (e.g. in a database), invalidate the stored token.

Parameters

RememberMeDetails $rememberMeDetails

Return Value

UserInterface

Exceptions

AuthenticationException

void clearRememberMeCookie()

Clears the remember-me cookie.

This should set a cookie with a null value on the request attribute.

Return Value

void