mirror of
https://github.com/django/django.git
synced 2025-08-08 19:09:15 +00:00
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
|
modified = request.session.modified
|
||||||
empty = request.session.is_empty()
|
empty = request.session.is_empty()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
return response
|
||||||
else:
|
|
||||||
# First check if we need to delete this cookie.
|
# 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:
|
if settings.SESSION_COOKIE_NAME in request.COOKIES and empty:
|
||||||
response.delete_cookie(
|
response.delete_cookie(
|
||||||
settings.SESSION_COOKIE_NAME,
|
settings.SESSION_COOKIE_NAME,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user