From 2d4da641a6ee6c96f38336d8dc6786c07e7b3a1f Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 12 Sep 2010 20:52:49 +0000 Subject: 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 --- docs/ref/request-response.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs') 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 -- cgit v1.3