Example #1
0
 /**
  * Updates a session in the database.
  *
  * @param Session $session The updated session
  *
  * @throws Exception
  */
 public function updateSession(\PHPAuth\Model\Session $session)
 {
     $query = $this->dbh->prepare('
         UPDATE
             session
         SET
             session_user_agent = ?,
             session_ip_address = ?,
             session_expiry_date = ?,
             session_last_active_date = ?
         WHERE
             session_uuid = ?
     ');
     $execute = $query->execute(array($session->getUserAgent(), $session->getIpAddress(), $session->getExpiryDate(), $session->getLastActiveDate(), $session->getUuid()));
     if (!$execute) {
         throw new \Exception("system_error");
     }
 }