[issue22983] Cookie parsing should be more permissive

Demian Brecht report at bugs.python.org
Tue Dec 2 17:59:37 CET 2014


New submission from Demian Brecht:

As found in #22931, if an invalid cookie value is found while parsing, the rest of the cookie is silently ignored. The expected behavior is undefined in RFC 6265, but does state that if unexpected values are encountered that user agents MAY ignore an entire set-cookie string (not just a subsection of it). Given that, invalid cookie portions should likely be handled by either:

1. Ignore the cookie string in its entirety and log an error message, or
2. Ignore invalid cookie-pairs but still parse the rest of the string

The latter would likely be the best path (Postel's law and all)

----------
components: Library (Lib)
messages: 232020
nosy: demian.brecht
priority: normal
severity: normal
status: open
title: Cookie parsing should be more permissive
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22983>
_______________________________________


More information about the Python-bugs-list mailing list