DoctrineTokenProvider
in package
implements
TokenProviderInterface
This class provides storage for the tokens that is set in "remember me" cookies. This way no password secrets will be stored in the cookies on the client machine, and thus the security is improved.
This depends only on doctrine in order to get a database connection and to do the conversion of the datetime column.
In order to use this class, you need the following table in your database:
CREATE TABLE `rememberme_token` (
`series` char(88) UNIQUE PRIMARY KEY NOT NULL,
`value` char(88) NOT NULL,
`lastUsed` datetime NOT NULL,
`class` varchar(100) NOT NULL,
`username` varchar(200) NOT NULL
);
Interfaces, Classes, Traits and Enums
- TokenProviderInterface
- Interface for TokenProviders.
Table of Contents
- $conn : mixed
- $useDeprecatedConstants : mixed
- __construct() : mixed
- createNewToken() : mixed
- Creates a new token.
- deleteTokenBySeries() : mixed
- Deletes all tokens belonging to series.
- loadTokenBySeries() : PersistentTokenInterface
- Loads the active token for the given series.
- updateToken() : mixed
- Updates the token according to this data.
Properties
$conn
private
mixed
$conn
$useDeprecatedConstants
private
static mixed
$useDeprecatedConstants
Methods
__construct()
public
__construct(Connection $conn) : mixed
Parameters
- $conn : Connection
Return values
mixed —createNewToken()
Creates a new token.
public
createNewToken(PersistentTokenInterface $token) : mixed
Parameters
- $token : PersistentTokenInterface
Return values
mixed —deleteTokenBySeries()
Deletes all tokens belonging to series.
public
deleteTokenBySeries(mixed $series) : mixed
Parameters
- $series : mixed
Return values
mixed —loadTokenBySeries()
Loads the active token for the given series.
public
loadTokenBySeries(mixed $series) : PersistentTokenInterface
Parameters
- $series : mixed
Return values
PersistentTokenInterface —updateToken()
Updates the token according to this data.
public
updateToken(mixed $series, mixed $tokenValue, DateTime $lastUsed) : mixed
Parameters
- $series : mixed
- $tokenValue : mixed
- $lastUsed : DateTime