From 85b10baa2f032b85573fcc9e0840a171b2fc15cd Mon Sep 17 00:00:00 2001 From: llj Date: Wed, 22 Aug 2012 16:22:10 +0800 Subject: [PATCH] [cookie]modified for ie --- templates/base.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/base.html b/templates/base.html index e9f6c96b63..accd9b7695 100644 --- a/templates/base.html +++ b/templates/base.html @@ -135,9 +135,12 @@ $('#info-bar .close').click(function() { $('#info-bar').addClass('hide'); if (navigator.cookieEnabled) { - var cookies = document.cookie.split('; '), + var date = new Date(), + cookies = document.cookie.split('; '), note_id_exist = false, - new_note_id = $(this).attr('data') + ',' + '; max-age=' + 14*24*60*60 + '; path=' + '{{ SITE_ROOT }}'; + new_note_id = $(this).attr('data') + ','; + date.setTime(date.getTime() + 14*24*60*60*1000); + new_note_id += '; expires=' + date.toGMTString() + '; path=' + '{{ SITE_ROOT }}'; for (var i = 0, len = cookies.length; i < len; i++) { if (cookies[i].split('=')[0] == 'note_id') { note_id_exist = true;