mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +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:
parent
7c075440ea
commit
2d4da641a6
3 changed files with 55 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue