<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(session):
 """Login to Voobly."""

    if not session.auth.username or not session.auth.password:
        raise VooblyError('must supply username and password')
    _LOGGER.info("logging in (no valid cookie found)")
    session.cookies.clear()
    try:
        session.get(session.auth.base_url + LOGIN_PAGE)
        resp = session.post(session.auth.base_url + LOGIN_URL, data={
            'username': session.auth.username,
            'password': session.auth.password
        })
    except RequestException:
        raise VooblyError('failed to connect for login')
    if resp.status_code != 200:
        raise VooblyError('failed to login')
    _save_cookies(session.cookies, session.auth.cookie_path)