def _login(self):
        if self._session_id is not None:
            raise PMException("Already logged in.")

        response = self._call("session_login", username=self._credentials[0],
                                              password=self._credentials[1])
        if response is None:
            raise PMException("Login failed: Got no session id.")
        self._session_id = response