1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

[1.8.x] Fixed #24799 -- Fixed session cookie deletion when using SESSION_COOKIE_DOMAIN

Backport of 2dee853ed4 from master
This commit is contained in:
Bo Lopker
2015-05-13 23:22:42 -07:00
committed by Tim Graham
parent 6a0d9f068f
commit 3c659856eb
3 changed files with 34 additions and 1 deletions

View File

@@ -31,7 +31,8 @@ class SessionMiddleware(object):
# First check if we need to delete this cookie.
# The session should be deleted only if the session is entirely empty
if settings.SESSION_COOKIE_NAME in request.COOKIES and empty:
response.delete_cookie(settings.SESSION_COOKIE_NAME)
response.delete_cookie(settings.SESSION_COOKIE_NAME,
domain=settings.SESSION_COOKIE_DOMAIN)
else:
if accessed:
patch_vary_headers(response, ('Cookie',))