<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def login(self, login, password, set_auth=False):
 """ Attempts a login to the remote server and on success returns user id and session or None Warning: Do not depend on this. This will be deprecated with SSO. param set_auth: sets the authentication on the client """

        rv = self.session.post(
            self.host,
            dumps({
                "method": "common.db.login",
                "params": [login, password]
            }),
        )
        rv = loads(rv.content)['result']
        if set_auth:
            self.set_auth(
                SessionAuth(login, *rv)
            )
        return rv