Commits

zsp042  committed 70439db Draft

update on line

  • Participants
  • Parent commits ddef280
  • Branches 42qu

Comments (0)

Files changed (1)

File zweb/_tornado.py

     morsel = self._new_cookie[name]
     if domain:
         morsel["domain"] = domain
-    if not expires and not expires_days:
-        expires_days = 999
+
+
+
     if expires_days is not None and not expires:
         expires = datetime.datetime.utcnow() + datetime.timedelta(
             days=expires_days)
     if expires:
-        timestamp = calendar.timegm(expires.utctimetuple())
-        morsel["expires"] = email.utils.formatdate(
-            timestamp, localtime=False, usegmt=True)
+        if type(expires) is not str:
+            timestamp = calendar.timegm(expires.utctimetuple())
+            expires = email.utils.formatdate(
+                timestamp, localtime=False, usegmt=True
+            )
+        new_cookie[name]['expires'] = expires
+    else:
+        new_cookie[name]['expires'] = 'Tue, 01 Jan 2030 00:00:00 GMT'
 
 
     if path: