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 berker.peksag
Recipients Mark.Williams, ajaksu2, alex, berker.peksag, zdobersek, zenzen
Date 2018-04-20.03:04:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524193459.21.0.682650639539.issue991266@psf.upfronthosting.co.za>
In-reply-to
Content
>>> from http.cookies import SimpleCookie
>>> c = SimpleCookie()
>>> c['name'] = 'value'
>>> c['name']['comment'] = '\n'
>>> c['name']['expires'] = '123; path=.example.invalid'
'Set-Cookie: name=value; Comment="\\012"; expires=123; path=.example.invalid'

What do you think that the snippet above should return?

    'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT; path=.example.invalid'

or

    'Set-Cookie: name=value; Comment="\\012"; expires=Fri, 20 Apr 2018 02:03:13 GMT; path=".example.invalid"'

or

    'Set-Cookie: name=value; Comment="\\012"; expires=123; path=".example.invalid"'

?

I don't think the path attribute (or all of them) needs to be quoted unconditionally. Looking at https://tools.ietf.org/html/rfc6265#section-4.1.1, it looks like quoting for cookie-value is optional.

Is there a use case or examples from other programming languages you can share with us?
History
Date User Action Args
2018-04-20 03:04:19berker.peksagsetrecipients: + berker.peksag, zenzen, ajaksu2, alex, zdobersek, Mark.Williams
2018-04-20 03:04:19berker.peksagsetmessageid: <1524193459.21.0.682650639539.issue991266@psf.upfronthosting.co.za>
2018-04-20 03:04:19berker.peksaglinkissue991266 messages
2018-04-20 03:04:18berker.peksagcreate