Simplified SessionMiddleware.process_response() a bit.
This commit is contained in:
parent
480492fe70
commit
59f04d6b8f
|
@ -30,10 +30,9 @@ class SessionMiddleware(MiddlewareMixin):
|
|||
modified = request.session.modified
|
||||
empty = request.session.is_empty()
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
return response
|
||||
# First check if we need to delete this cookie.
|
||||
# The session should be deleted only if the session is entirely empty
|
||||
# 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,
|
||||
|
|
Loading…
Reference in New Issue