Andres Riancho <[EMAIL PROTECTED]> added the comment:

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!

[EMAIL PROTECTED]:~$ 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.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1028088>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to