Changeset 3545
- Timestamp:
- 08/09/06 10:40:24 (2 years ago)
- Files:
-
- django/trunk/django/http/__init__.py (modified) (2 diffs)
- django/trunk/docs/request_response.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/http/__init__.py
r3410 r3545 39 39 def get_full_path(self): 40 40 return '' 41 41 42 42 def is_secure(self): 43 43 return os.environ.get("HTTPS") == "on" … … 204 204 self.cookies[key][var.replace('_', '-')] = val 205 205 206 def delete_cookie(self, key): 207 try: 208 self.cookies[key]['max_age'] = 0 209 except KeyError: 210 pass 206 def delete_cookie(self, key, path='/', domain=None): 207 self.cookies[key] = '' 208 if path is not None: 209 self.cookies[key]['path'] = path 210 if domain is not None: 211 self.cookies[key]['domain'] = path 212 self.cookies[key]['expires'] = 0 213 self.cookies[key]['max-age'] = 0 211 214 212 215 def _get_content(self): django/trunk/docs/request_response.txt
r3410 r3545 150 150 151 151 Example: ``"/music/bands/the_beatles/?print=true"`` 152 152 153 153 ``is_secure()`` 154 154 Returns ``True`` if the request is secure; that is, if it was made with … … 381 381 .. _`cookie Morsel`: http://www.python.org/doc/current/lib/morsel-objects.html 382 382 383 ``delete_cookie(key )``383 ``delete_cookie(key, path='/', domain=None)`` 384 384 Deletes the cookie with the given key. Fails silently if the key doesn't 385 385 exist. 386 387 The ``path`` and ``domain`` arguments are new in the Django development version. 388 Due to the way cookies work, ``path`` and ``domain`` should be the same 389 values you used in ``set_cookie()`` -- otherwise the cookie may not be deleted. 386 390 387 391 ``content``
