public function logout() { $session = User::getSession(); $session->remove('ua_token'); $session->remove('ua_user_id'); try { $this->_client->user->logout(); } catch (\UserApp\Exceptions\ServiceException $exception) { if ($exception->getErrorCode() == 'INVALID_CREDENTIALS') { return false; } throw $exception; } return true; }