This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author andresriancho
Recipients akuchling, andresriancho, facundobatista, jjlee, sirilyan
Date 2008-10-10.02:15:30
SpamBayes Score 4.6776638e-11
Marked as misclassified No
Message-id <1223604933.33.0.220705517332.issue1028088@psf.upfronthosting.co.za>
In-reply-to
Content
My problem, and the problem if the original bug reporter (sirilyan) is
that the load method ignores names that don't have values. Quoting the
original bug report:

>>> import Cookie
>>> q = Cookie.SimpleCookie("pie=good; broken;
other=thing")
>>> q
<SimpleCookie: other='thing' pie='good'>

The original bug report suggested raising a warning or something. I
don't like that idea too much. What I would like to see is the "secure"
cookie parameter, which BY RFC has no value, be parsed as expected.

Right now is you .load() a cookie that looks like this: "a=b; secure"
and then you want to write that cookie back, you loose the secure parameter!

dz0@brick:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Cookie
>>> C = Cookie.SimpleCookie()
>>> C.load("chips=ahoy; vienna=finger")
>>> print C
Set-Cookie: chips=ahoy
Set-Cookie: vienna=finger
>>> C.load("chips=ahoy; vienna=finger; secure")
>>> print C
Set-Cookie: chips=ahoy
Set-Cookie: vienna=finger
>>> 

I'm not sure if I'm being clear enough, please tell me if you need me to
rewrite something, or use other examples.
History
Date User Action Args
2008-10-10 02:15:33andresrianchosetrecipients: + andresriancho, akuchling, facundobatista, jjlee, sirilyan
2008-10-10 02:15:33andresrianchosetmessageid: <1223604933.33.0.220705517332.issue1028088@psf.upfronthosting.co.za>
2008-10-10 02:15:32andresriancholinkissue1028088 messages
2008-10-10 02:15:30andresrianchocreate