'Method that retrieves current cookie from AP'

def get_cookie(self):

    url = '{}:{}'.format(self.target, self.port)
    pattern = 'RpWebID=([a-z0-9]{8})'
    print_status('Attempting    to    get    cookie...')
    try:
        r = http_request(method='GET', url=url, timeout=3)
        tgt_cookie = re.search(pattern, r.text)
        if (tgt_cookie is None):
            print_error('Unable    to    retrieve    cookie')
        else:
            return tgt_cookie.group(1)
    except Exception:
        print_error('Unable    to    connect    to    target')
