Closed yankos closed 2 years ago
Very simple code for reproduce an issue. The order of the cookies in the header matters.
Tested on Python 3.8, Python 3.9, PyPy 3.7.1, PyPy 3.7.5
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from http.cookies import SimpleCookie
>>> cookie_raw_only_first = 'G_ENABLED_IDPS=google; g_state={"i_l":0}; csid=kkJIz6LddA4y5zXFTF3nE7mVLzQffmV3'
>>> print(SimpleCookie(cookie_raw_only_first).keys())
dict_keys(['G_ENABLED_IDPS'])
>>> cookie_raw_all = 'G_ENABLED_IDPS=google; csid=kkJIz6LddA4y5zXFTF3nE7mVLzQffmV3'
>>> print(SimpleCookie(cookie_raw_all).keys())
dict_keys(['G_ENABLED_IDPS', 'csid'])
>>> cookie_raw_csid_ok_but_not_full = 'G_ENABLED_IDPS=google; csid=kkJIz6LddA4y5zXFTF3nE7mVLzQffmV3; g_state={"i_l":0}'
>>> print(SimpleCookie(cookie_raw_csid_ok_but_not_full).keys())
dict_keys(['G_ENABLED_IDPS', 'csid'])
>>> cookie_raw_csid_strict_json = 'G_ENABLED_IDPS=google; g_state="{\"i_l\":0}"; csid=kkJIz6LddA4y5zXFTF3nE7mVLzQffmV3'
>>> print(SimpleCookie(cookie_raw_csid_strict_json).keys())
dict_keys(['G_ENABLED_IDPS'])
>>>
@oberstet Can I help you with this PR?
@yankos sorry, it's not a priority for me, and I lack time ...
Crossbar version:
Steps to reproduce:
Make the Cookie Authentication with Google's
g_state
cookie:g_state={"i_l":0}
Python can't parse cookies ifg_state
cookie is present and because of this creates newcsid
cookie every time. Google setsg_state
cookie for "One Tap sign-in".Output: