summaryrefslogtreecommitdiff
path: root/django/http/response.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-09-04 14:04:21 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-09-05 10:07:23 +0200
commitd2d08c8cf6ed601d52e25cb8fc7944d39b5ed56e (patch)
tree07fb5a9ad1ef9415b867ad772b5f196c2339ba5a /django/http/response.py
parente6b5108acc79dcff5bc90bc97500569c74a807bc (diff)
Fixed #31982 -- Made HttpResponse.set_cookie() cast max_age argument to an integer.
Diffstat (limited to 'django/http/response.py')
-rw-r--r--django/http/response.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/http/response.py b/django/http/response.py
index c0ed93c44e..64ac205087 100644
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -184,7 +184,7 @@ class HttpResponseBase:
else:
self.cookies[key]['expires'] = ''
if max_age is not None:
- self.cookies[key]['max-age'] = max_age
+ self.cookies[key]['max-age'] = int(max_age)
# IE requires expires, so set it if hasn't been already.
if not expires:
self.cookies[key]['expires'] = http_date(time.time() + max_age)