/**
  *
  * Forces a successful login.
  *
  * @param Auth $auth The authentication tracking object.
  *
  * @param string $name The authenticated user name.
  *
  * @param string $data Additional arbitrary user data.
  *
  * @param string $status The new authentication status.
  *
  * @return string|false The authentication status on success, or boolean
  * false on failure.
  *
  */
 public function forceLogin(Auth $auth, $name, array $data = array(), $status = Status::VALID)
 {
     $started = $this->session->resume() || $this->session->start();
     if (!$started) {
         return false;
     }
     $this->session->regenerateId();
     $auth->set($status, time(), time(), $name, $data);
     return $status;
 }
 /**
  *
  * Forces a successful logout.
  *
  * @param Auth $auth An authentication tracker.
  *
  * @param string $status The status after logout.
  *
  * @return string The new authentication status.
  *
  */
 public function forceLogout(Auth $auth, $status = Status::ANON)
 {
     $this->session->regenerateId();
     $auth->set($status, null, null, null, array());
     return $status;
 }