#28965 closed Cleanup/optimization (fixed)
Update cookie date format to follow RFC2616
Reported by: | Alexey | Owned by: | Alexey |
---|---|---|---|
Component: | Utilities | Version: | 2.0 |
Severity: | Normal | Keywords: | cookie |
Cc: | Sergey Fedoseev | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
For some reason Django set expires for cookies with hyphens in date (Tue, 25-Dec-2018 22:26:13 GMT).
Seems it was first introduced in 390666ac2bf8223bede4f78a97836051bc9f9526 to fix #508
The proper format is UTC string (RFC-1123): Tue, 25 Dec 2018 21:15:29 GMT
Change History (14)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
expires
cookie is defined by RFC 6265 (April 2011). It says that server SHOULD format expires
cookie value as rfc1123-date, defined in RFC2616 (without hyphens). User agent MUST parse that value more permissively, for example allow hyphens as delimiters.
Currently Django uses format defined by pre-RFC "Netscape cookie specification" mentioned in the introduction of RFC 6265. Perhaps IE understands only that format https://blogs.msdn.microsoft.com/ieinternals/2009/08/20/internet-explorer-cookie-internals-faq/.
comment:4 by , 7 years ago
Cc: | added |
---|
comment:5 by , 7 years ago
Summary: | Wrong format for cookie 'expires' → Update cookie date format to follow RFC2616 |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
Hopefully nothing will break if we follow the newest RFC.
comment:6 by , 7 years ago
For me it just cosmetic change.
I think that there is no reason to support browser that is already unsupported.
comment:7 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:9 by , 7 years ago
Patch needs improvement: | set |
---|
I left some comments for improvement on the PR.
comment:10 by , 7 years ago
Patch needs improvement: | unset |
---|
I updated the patch to switch usages of cookie_date()
to http_date()
and added a commit to deprecate the now unused cookie_date()
function.
Are you seeing a problematic behavior or is this merely cosmetic?