'Checks if a cookie marked as secure is sent over http.
Reference:
http://en.wikipedia.org/wiki/HTTP_cookie
: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 _secure_over_http(self, request, response, cookie_obj, cookie_header_value):

    if (self.SECURE_RE.search(cookie_header_value) and (response.get_url().get_protocol().lower() == 'http')):
        desc = 'A    cookie    marked    with    the    secure    flag    was    sent    over    an    insecure    channel    (HTTP)    when    requesting    the    URL:    "%s",    this    usually    means    that    the    Web    application    was    designed    to    run    over    SSL    and    was    deployed    without    security    or    that    the    developer    does    not    understand    the    "secure"    flag.'
        desc = (desc % response.get_url())
        v = CookieVuln('Secure    cookie    over    HTTP', desc, severity.HIGH, response.id, self.get_name())
        v.set_url(response.get_url())
        v.set_cookie_object(cookie_obj)
        kb.kb.append(self, 'false_secure', v)
