Cap lifetime of persistent cookies created client-side through document.cookie
[WebKit-https.git] / LayoutTests / http / tests / cookies / resources / cookie-utilities.js
index 07c0c03..91ff860 100644 (file)
@@ -239,3 +239,10 @@ function setCookieUsingWebSocketFromHost(host)
     });
     return promise;
 }
+
+function createExpiresDateFromMaxAge(maxAgeInSeconds)
+{
+    let date = new Date();
+    date.setTime(date.getTime() + (maxAgeInSeconds * 1000));
+    return date.toUTCString();
+}