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 r.david.murray
Recipients BM, BreamoreBoy, aclover, akuchling, carsten.klein, dstanek, georg.brandl, jerry.seutter, jjlee, karlcow, r.david.murray, spookylukey, tim.peters
Date 2011-06-29.15:32:54
SpamBayes Score 6.8689747e-09
Marked as misclassified No
Message-id <1309361575.14.0.19902868663.issue2193@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for taking a crack at this.  IMO the thing that needs to be fixed here is that receiving an invalid cookie makes it difficult to receive the valid cookies.  I'd love to accept your patch, but "silently ignore" sounds like a bad idea and is something we try to avoid in Python where practical.  In the email package we have a mechanism for reporting RFC violations (the defects attribute).  And we make as much sense of the input as we can, even if it is invalid, and preserve it.  We even allow generation of some RFC-invalid stuff, though we have plans to make applications work harder to do that in the future.

So I think your harder fix (accept the RFC-invalid cookies as long as there is some sensible way to parse them, but reject creating them) is the right approach.  I could also see the possibility of accepting a feature request for adding the ability to explicitly create RFC-invalid cookies, if someone can demonstrate a use case for doing so.  Other possible follow-on feature requests would be a 'defects' facility and/or a way to explicitly request that non-compliant cookies be ignored.

Note that in suggesting we reject creating RFC-invalid cookies by default I am not expressing an opinion on the relevance of the RFCs to cookie processing "in the wild".  Given that there is a standard and we are talking about what to do on generation, the obvious answer (by Postel's law) is that we ought to generate standards-compliant cookies.

Also note that I have not looked at the referenced rfc (here is what I believe is the official link: http://tools.ietf.org/html/rfc6265).
History
Date User Action Args
2011-06-29 15:32:55r.david.murraysetrecipients: + r.david.murray, tim.peters, akuchling, georg.brandl, jjlee, dstanek, jerry.seutter, BM, aclover, karlcow, BreamoreBoy, spookylukey, carsten.klein
2011-06-29 15:32:55r.david.murraysetmessageid: <1309361575.14.0.19902868663.issue2193@psf.upfronthosting.co.za>
2011-06-29 15:32:54r.david.murraylinkissue2193 messages
2011-06-29 15:32:54r.david.murraycreate