Message315499
>>> 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? |
|
Date |
User |
Action |
Args |
2018-04-20 03:04:19 | berker.peksag | set | recipients:
+ berker.peksag, zenzen, ajaksu2, alex, zdobersek, Mark.Williams |
2018-04-20 03:04:19 | berker.peksag | set | messageid: <1524193459.21.0.682650639539.issue991266@psf.upfronthosting.co.za> |
2018-04-20 03:04:19 | berker.peksag | link | issue991266 messages |
2018-04-20 03:04:18 | berker.peksag | create | |
|