def cookies ( self ) -> Dict [ str , str ] : cookies = SimpleCookie ( ) cookies . load ( self . headers . get ( 'Cookie' , '' ) ) return { key : cookie . value for key , cookie in cookies . items ( ) }
how to get all cookies from python request
The parsed cookies attached to this request .
def cookies(self) -> Dict[str, str]:
        """The parsed cookies attached to this request."""
        cookies = SimpleCookie()
        cookies.load(self.headers.get('Cookie', ''))
        return {key: cookie.value for key, cookie in cookies.items()}