// Persist a copy of the previous token for authentication
// in verifyToken should the old token still be sent by the browser
// in a request concurrent to the one that did this token update
$tmpSeries =
preg_replace('{=+$}', '_',
$token->
getSeries());
// if we cannot generate a unique series it is not worth trying further
if ($tmpSeries ===
$token->
getSeries()) { return;
} $this->conn->
beginTransaction();
try { $this->
deleteTokenBySeries($tmpSeries);
$lastUsed = \DateTime::
createFromInterface($lastUsed);
$this->
createNewToken(new PersistentToken($token->
getClass(),
$token->
getUserIdentifier(),
$tmpSeries,
$token->
getTokenValue(),
$lastUsed));
$this->conn->
commit();
} catch (\Exception
$e) { $this->conn->
rollBack();
throw $e;
} } /**
* Adds the Table to the Schema if "remember me" uses this Connection.
*
* @param \Closure $isSameDatabase
*/