Logs into the bluecoat_sslv device and returns the session cookies.

def logon():
    '''
    Logs into the bluecoat_sslv device and returns the session cookies.
    '''
    session = requests.session()
    payload = {"jsonrpc": "2.0",
               "id": "ID0",
               "method": "login",
               "params": [DETAILS['username'], DETAILS['password'], DETAILS['auth'], True]
               }

    logon_response = session.post(DETAILS['url'], data=json.dumps(payload), verify=False)

    if logon_response.status_code != 200:
        log.error("Error logging into proxy. HTTP Error code: %s",
                  logon_response.status_code)
        raise salt.exceptions.CommandExecutionError(
            "Did not receive a valid response from host.")

    try:
        cookies = {'sslng_csrf_token': logon_response.cookies['sslng_csrf_token'],
                   'sslng_session_id': logon_response.cookies['sslng_session_id']}
        csrf_token = logon_response.cookies['sslng_csrf_token']
    except KeyError:
        log.error("Unable to authentication to the bluecoat_sslv proxy.")
        raise salt.exceptions.CommandExecutionError(
            "Did not receive a valid response from host.")

    return session, cookies, csrf_token