summaryrefslogtreecommitdiff
path: root/django/utils/httpwrappers.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-09-23 01:17:39 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-09-23 01:17:39 +0000
commit3dc1ede8718056cf107abf06f6f213cbe23374c8 (patch)
treead57c2078882b73a114578d99b05bfb0ff0d437d /django/utils/httpwrappers.py
parent8df0df620f294289bfd3789db29822cac4b9a741 (diff)
Fixed #236 -- Added HttpResponse.delete_cookie() method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@668 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/httpwrappers.py')
-rw-r--r--django/utils/httpwrappers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/utils/httpwrappers.py b/django/utils/httpwrappers.py
index 107b63d40b..8b50688f66 100644
--- a/django/utils/httpwrappers.py
+++ b/django/utils/httpwrappers.py
@@ -175,6 +175,12 @@ class HttpResponse:
if val is not None:
self.cookies[key][var.replace('_', '-')] = val
+ def delete_cookie(self, key):
+ try:
+ self.cookies[key]['max_age'] = 0
+ except KeyError:
+ pass
+
def get_content_as_string(self, encoding):
"""
Returns the content as a string, encoding it from a Unicode object if