cookie.delete doesn't take domain, path, or secure

John Reese <[email protected]>
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
Currently, if you want to delete a cookie on a non-default path, you have to use
  cookie.set(key, None, path=X)
which seems silly, so I propose the following patch.  Comments welcome.
cookie.patch (application/octet-stream, 620 B)
Index: modules/cookie.py
===================================================================
--- modules/cookie.py	(revision 815)
+++ modules/cookie.py	(working copy)
@@ -49,9 +49,9 @@
     if path: text = text + ';PATH=%s' % path
     if secure: text = text + ';SECURE'
     self._api.getModule('response').addHeader('Set-Cookie', text)
-  def delete(self, key):
+  def delete(self, key, domain=None, path=None, secure=0):
     "Delete browser cookie"
-    self.set(key, None)
+    self.set(key, None, domain, path, secure)
   def __delitem__(self, key):
     "Delete browser cookie"
     return self.delete(self, key)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.