commit d2005a167b3ddce5f1947ab14a04d94896c803e1 Author: Alexandre Allaire alexandre.allaire@mail.mcgill.ca Date: Wed Dec 5 22:25:16 2012 -0500
Set cookie using expires instead of max-age.
max-age is not supported in Internet Explorer. Also add / as path parameter so the badge can be hosted anywhere on the domain. --- proxy/options.js | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/proxy/options.js b/proxy/options.js index 1377373..350b472 100644 --- a/proxy/options.js +++ b/proxy/options.js @@ -3,8 +3,8 @@ code should run or disable itself. */
var COOKIE_NAME = "flashproxy"; -/* In seconds. */ -var COOKIE_LIFETIME = 60 * 60 * 24 * 365; +/* max-age is not supported in IE. */ +var COOKIE_LIFETIME = "Thu, 01 Jan 2020 00:00:00 GMT";
window.addEventListener("load", function () {
@@ -38,11 +38,11 @@ window.addEventListener("load", function () { }
function set_cookie() { - document.cookie = COOKIE_NAME + "=; max-age=" + COOKIE_LIFETIME; + document.cookie = COOKIE_NAME + "= ;path=/ ;expires=" + COOKIE_LIFETIME; }
function del_cookie() { - document.cookie = COOKIE_NAME + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT"; + document.cookie = COOKIE_NAME + "= ;path=/ ;expires=Thu, 01 Jan 1970 00:00:00 GMT"; }
if (cookies_enabled()) {
tor-commits@lists.torproject.org