mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user