[issue27674] Quote mark breaks http.cookies, Cookie.py processing

2020-09-03 Thread Benoît Brayer

Benoît Brayer  added the comment:

Please find what Django's devs have done to parse cookies: 

https://github.com/django/django/commit/93a135d111c2569d88d65a3f4ad9e6d9ad291452

I hope this might help to find a solution.

--
nosy: +brayer.benoit

___
Python tracker 
<https://bugs.python.org/issue27674>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41695] http.cookies.SimpleCookie.parse could not parse cookies when one cookie value is json

2020-09-02 Thread Benoît Brayer

New submission from Benoît Brayer :

Using python3.8.5, SimpleCookie parser seems to be unable to load the cookie 
string when a json string is used inside one of the cookie values.

I did not try to replay using other python3 versions yet.

Please use the following code to replay the bug:

>>> from http import cookies
>>> cookie_parser = cookies.SimpleCookie()
>>> cookie_parser.load('CookieScriptConsent={"action":"accept"}; 
>>> __stripe_mid=plip; __stripe_sid=plop; _ga=tada; _gcl_au=pouet; _hjid=hello; 
>>> authn_token=mylogin; rememberMe=true')
>>> cookie_parser.keys()
dict_keys([])
>>> cookie_parser = cookies.SimpleCookie()
>>> cookie_parser.load('__stripe_mid=plip; __stripe_sid=plop; _ga=tada; 
>>> _gcl_au=pouet; _hjid=hello; authn_token=mylogin; rememberMe=true')
>>> cookie_parser.keys()
dict_keys(['__stripe_mid', '__stripe_sid', '_ga', '_gcl_au', '_hjid', 
'authn_token', 'rememberMe'])

--
messages: 376253
nosy: brayer.benoit
priority: normal
severity: normal
status: open
title: http.cookies.SimpleCookie.parse could not parse cookies when one cookie 
value is json
type: behavior
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue41695>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com