'Checks if a cookie that does NOT have a secure flag is sent over https.
:param request: The http request object
:param response: The http response object
:param cookie_obj: The cookie object to analyze
:param cookie_header_value: The cookie, as sent in the HTTP response
:return: None'

def _not_secure_over_https(self, request, response, cookie_obj, cookie_header_value):

    if ((response.get_url().get_protocol().lower() == 'https') and (not self.SECURE_RE.search(cookie_header_value))):
        desc = 'A    cookie    without    the    secure    flag    was    sent    in    an    HTTPS    response    at    "%s".    The    secure    flag    prevents    the    browser    from    sending    a    "secure"    cookie    over    an    insecure    HTTP    channel,    thus    preventing    potential    session    hijacking    attacks.'
        desc = (desc % response.get_url())
        v = CookieVuln('Secure    flag    missing    in    HTTPS    cookie', desc, severity.MEDIUM, response.id, self.get_name())
        v.set_url(response.get_url())
        v.set_cookie_object(cookie_obj)
        self.kb_append_uniq_group(self, 'secure', v, group_klass=NotSecureFlagCookieInfoSet)
