public function saveSecret(Token $token) { setcookie(self::CV_SECRET, $token->getSecret(), $token->getExpirationDate()); $_COOKIE[self::CV_SECRET] = $token->getSecret(); }
/** * @param Token $token * @return User|null An user object or null if not found */ public function getByToken(Token $token) { return $this->database->get(User::class, $token->getUserId()); }