public function testToken()
 {
     $token = new RememberMeToken(1, "login_token", "token");
     $this->assertEquals("token", $token->getToken());
     $token->setToken("token_2");
     $this->assertEquals("token_2", $token->getToken());
 }
 /**
  * adds the user data to the session
  * 
  * @param UserInterface $user
  * @param bool $rememberMe
  * @return bool
  */
 private function setSessionData(UserInterface $user, bool $rememberMe = false)
 {
     // process remember me
     if ($rememberMe) {
         $rememberMeToken = new RememberMeToken($user->getId(), $this->loginToken->getToken());
         $this->loginToken->setRememberMeToken(password_hash($rememberMeToken->getToken(), PASSWORD_BCRYPT));
         $rememberMeExpire = time() + $this->rememberMeLifetime;
         $this->loginToken->setRememberMeExpire($rememberMeExpire);
         $this->setRememberCookie(base64_encode($rememberMeToken->toString()), $rememberMeExpire);
     }
     // set session keys
     $this->session->regenerate();
     $this->session->set("security._user", $user->getId());
     $this->session->set("security._logintoken", $this->loginToken->getToken());
     return true;
 }