Julien Phalip added the comment:

I'm attaching a suggested patch to fix the issues relating to 
serializing/deserializing the httponly and secure flags. The main idea is that 
for a flag to be active, it needs to both be set and have the True value.

I think this is a much more correct and saner approach than the current 
implementation. As it's been discussed previously, currently the httponly and 
secure flag are systematically given the empty string as default value when 
instantiating a Morsel object. So one would infer that the empty string means 
that the flags are inactive. However, when deserializing a Morsel object, the 
empty string is used to indicate that a flag is active. Both behaviors 
contradict each other.

While the suggested change is backwards-incompatible, it would break the code 
of developers relying on an inconsistent behavior. So perhaps this might be 
compelling enough to allow breaking backwards compatibility in this case.

Let me know what you think. Thanks!

----------
keywords: +patch
nosy: +julien.phalip
versions:  -Python 2.7
Added file: http://bugs.python.org/file30962/cookies-httponly-secure.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16611>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to