1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

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'.
This commit is contained in:
Raphael Merx
2015-10-30 15:05:11 -07:00
committed by Tim Graham
parent 6258e16335
commit 0a19f8d4fc
2 changed files with 14 additions and 0 deletions

View File

@@ -190,6 +190,8 @@ class HttpResponseBase(six.Iterator):
max_age = max(0, delta.days * 86400 + delta.seconds)
else:
self.cookies[key]['expires'] = expires
else:
self.cookies[key]['expires'] = ''
if max_age is not None:
self.cookies[key]['max-age'] = max_age
# IE requires expires, so set it if hasn't been already.