summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2010-09-12 20:52:49 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2010-09-12 20:52:49 +0000
commit2d4da641a6ee6c96f38336d8dc6786c07e7b3a1f (patch)
tree3aeba6caba6dbb8a889ceaa3a155949d1ec24d03 /docs
parent7c075440ea3fb082b9b081a3c1b20b2b62e0e4dc (diff)
Allow setting HttpResponse cookie expiry times with datetime objects.
Patch from SmileyChris. Fixed #7770. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/request-response.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index fb38b596e9..b8b08829e9 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -529,8 +529,11 @@ Methods
* ``max_age`` should be a number of seconds, or ``None`` (default) if
the cookie should last only as long as the client's browser session.
- * ``expires`` should be a string in the format
- ``"Wdy, DD-Mon-YY HH:MM:SS GMT"``.
+ If ``expires`` is not specified, it will be calculated.
+ * ``expires`` should either be a string in the format
+ ``"Wdy, DD-Mon-YY HH:MM:SS GMT"`` or a ``datetime.datetime`` object
+ in UTC. If ``expires`` is a ``datetime`` object, the ``max_age``
+ will be calculated.
* Use ``domain`` if you want to set a cross-domain cookie. For example,
``domain=".lawrence.com"`` will set a cookie that is readable by
the domains www.lawrence.com, blogs.lawrence.com and