chiark / gitweb /
cgi.py (cookie): Exclude attribute keys whose value is false.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 9 Mar 2013 05:27:29 +0000 (05:27 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 9 Mar 2013 05:35:11 +0000 (05:35 +0000)
cgi.py

diff --git a/cgi.py b/cgi.py
index b06ef85..05c6c9e 100644 (file)
--- a/cgi.py
+++ b/cgi.py
@@ -145,7 +145,7 @@ def cookie(name, value, **kw):
                                  T.gmtime(U.NOW + maxage))
   return '; '.join(['%s=%s' % (urlencode(name), urlencode(value))] +
                    [v is not True and '%s=%s' % (k, v) or k
-                    for k, v in attr.iteritems()])
+                    for k, v in attr.iteritems() if v])
 
 def action(*v, **kw):
   """