'Find session IDs in the URI and store them in the KB.'

def analyze_document_links(self, request, response):

    try:
        doc_parser = parser_cache.dpc.get_document_parser_for(response)
    except:
        pass
    else:
        (parsed_refs, _) = doc_parser.get_references()
        for link_uri in parsed_refs:
            if (self._has_sessid(link_uri) and (response.get_url() not in self._already_reported)):
                self._already_reported.add(response.get_url())
                desc = 'The    HTML    content    at    "%s"    contains    a    link    (%s)    which    holds    a    session    id.    The    ID    could    be    leaked    to    third    party    domains    through    the    referrer    header.'
                desc = (desc % (response.get_url(), link_uri))
                i = Info('Session    ID    in    URL', desc, response.id, self.get_name())
                i.set_uri(response.get_uri())
                self.kb_append(self, 'url_session', i)
                break
