(self, data)
Parse and manage session IDs.
            Return this requests ID
Parse and manage session IDs.
            Return this requests ID
Parse and manage session IDs . Return this requests ID
def manage_sessions(self, data):
        """ Parse and manage session IDs.
            Return this requests ID
        """
        # is there a session ID here?
        if 'session' in data.lower():

            # grab the host
            host = re.findall('Host: (.*)', data)
            if len(host) > 0:
                host = host[0]
            else:
                return None

            # grab the session; there are different ways this can be formatted in
            # the payload.  this should, for the most part, get the popular ones.
            # Probably will have a bunch of false positives, so this'll be tweaked.
            session_id = re.findall('.*?sess.*?[:|=](..*?)(&|;|$|:|\n| )', data.lower())
            if len(session_id) > 0:
                session_id = session_id[0][0]
            else:
                return None

            self.sessions[host] = session_id
            return session_id
def manage_sessions ( self , data ) : # is there a session ID here? if 'session' in data . lower ( ) : # grab the host host = re . findall ( 'Host: (.*)' , data ) if len ( host ) > 0 : host = host [ 0 ] else : return None # grab the session; there are different ways this can be formatted in # the payload.  this should, for the most part, get the popular ones. # Probably will have a bunch of false positives, so this'll be tweaked. session_id = re . findall ( '.*?sess.*?[:|=](..*?)(&|;|$|:|\n| )' , data . lower ( ) ) if len ( session_id ) > 0 : session_id = session_id [ 0 ] [ 0 ] else : return None self . sessions [ host ] = session_id return session_id