[ python-Bugs-1028088 ] Cookies without values are silently ignored (by design?)

SourceForge.net noreply at sourceforge.net
Tue Sep 14 20:05:42 CEST 2004


Bugs item #1028088, was opened at 2004-09-14 13:05
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1028088&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Doug Sheppard (sirilyan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Cookies without values are silently ignored (by design?)

Initial Comment:
Cookie._CookiePattern is the regular expression used to
retrieve cookies from the HTTP_COOKIE environment
variable.  This pattern assumes that all cookies are in
"name=value" format.  A cookie that doesn't have an
"=value" component is silently skipped over.  (It's
easy to generate a cookie like that - in JavaScript,
document.cookie="broken" is all it takes.)

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

If ignoring cookies without a "=value" component is
intended behaviour, it'd be nice to have a code comment
warning that's what happens.  If it's a bug, the cookie
should be set with an empty value.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1028088&group_id=5470


More information about the Python-bugs-list mailing list