def gotHeaders(self, headers):
        """
        Parse the response HTTP headers.

        @param headers: The response HTTP headers.
        @type headers: L{dict}
        """
        self.response_headers = headers
        if b'set-cookie' in headers:
            for cookie in headers[b'set-cookie']:
                if b'=' in cookie:
                    cookparts = cookie.split(b';')
                    cook = cookparts[0]
                    cook.lstrip()
                    k, v = cook.split(b'=', 1)
                    self.cookies[k.lstrip()] = v.lstrip()

        Parse the response HTTP headers.

        @param headers: The response HTTP headers.
        @type headers: L{dict}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/client.py