A failing test I wrote to verify this.
--
Ticket URL: <https://code.djangoproject.com/ticket/25644>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* type: Uncategorized => Bug
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:2>
Comment (by felixxm):
This seems easy to fix
{{{#!diff
--git a/django/http/response.py b/django/http/response.py
index ed5c14e..cdc098f 100644
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -216,7 +216,7 @@ class HttpResponseBase(six.Iterator):
def delete_cookie(self, key, path='/', domain=None):
self.set_cookie(key, max_age=0, path=path, domain=domain,
- expires='Thu, 01-Jan-1970 00:00:00 GMT')
+ expires='')
# Common methods used by subclasses
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:3>
Comment (by timgraham):
Will that still result in the browser deleting the cookie?
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:4>
Comment (by rollokb):
Replying to [comment:4 timgraham]:
> Will that still result in the browser deleting the cookie?
Tested, it doesn't.
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:5>
* owner: nobody => raphaelmerx
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:6>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/5523 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0a19f8d4fc864de481eac1b76c799ffd6ced4e91" 0a19f8d]:
{{{
#!CommitTicketReference repository=""
revision="0a19f8d4fc864de481eac1b76c799ffd6ced4e91"
Fixed #25644 -- Fixed reset cookie expiry date bug.
Setting a cookie with the same name as a previously deleted cookie
would set its expiry date to 'Thu, 01-Jan-1970 00:00:00 GMT'.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25644#comment:8>