RememberMeHandlerInterface
in
Handles creating and validating remember-me cookies.
If you want to add a custom implementation, you want to extend from AbstractRememberMeHandler instead.
Tags
Table of Contents
Methods
- clearRememberMeCookie() : void
- Clears the remember-me cookie.
- consumeRememberMeCookie() : UserInterface
- Validates the remember-me cookie and returns the associated User.
- createRememberMeCookie() : void
- Creates a remember-me cookie.
Methods
clearRememberMeCookie()
Clears the remember-me cookie.
public
clearRememberMeCookie() : void
This should set a cookie with a null
value on the request attribute.
consumeRememberMeCookie()
Validates the remember-me cookie and returns the associated User.
public
consumeRememberMeCookie(RememberMeDetails $rememberMeDetails) : UserInterface
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 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
Tags
Return values
UserInterfacecreateRememberMeCookie()
Creates a remember-me cookie.
public
createRememberMeCookie(UserInterface $user) : void
The actual cookie should be set as an attribute on the main request, which is transformed into a response cookie by ResponseListener.
Parameters
- $user : UserInterface