mirror of https://github.com/django/django.git
Got rid of a bit of repetition by using `dict.update()`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
7e210f68a9
commit
f5c1bb1cad
|
@ -291,12 +291,16 @@ class Client:
|
||||||
login(request, user)
|
login(request, user)
|
||||||
|
|
||||||
# Set the cookie to represent the session.
|
# Set the cookie to represent the session.
|
||||||
self.cookies[settings.SESSION_COOKIE_NAME] = request.session.session_key
|
session_cookie = settings.SESSION_COOKIE_NAME
|
||||||
self.cookies[settings.SESSION_COOKIE_NAME]['max-age'] = None
|
self.cookies[session_cookie] = request.session.session_key
|
||||||
self.cookies[settings.SESSION_COOKIE_NAME]['path'] = '/'
|
cookie_data = {
|
||||||
self.cookies[settings.SESSION_COOKIE_NAME]['domain'] = settings.SESSION_COOKIE_DOMAIN
|
'max-age': None,
|
||||||
self.cookies[settings.SESSION_COOKIE_NAME]['secure'] = settings.SESSION_COOKIE_SECURE or None
|
'path': '/',
|
||||||
self.cookies[settings.SESSION_COOKIE_NAME]['expires'] = None
|
'domain': settings.SESSION_COOKIE_DOMAIN,
|
||||||
|
'secure': settings.SESSION_COOKIE_SECURE or None,
|
||||||
|
'expires': None,
|
||||||
|
}
|
||||||
|
self.cookies[session_cookie].update(cookie_data)
|
||||||
|
|
||||||
# Save the session values.
|
# Save the session values.
|
||||||
request.session.save()
|
request.session.save()
|
||||||
|
|
Loading…
Reference in New Issue