In my JS code, I have thiswhich sets a "cookie" to expire in 1 day. However, I want it to expire in 1 hour instead. Is there a way to do that?Code:var expiredays = "1";
Thanks :)
Printable View
In my JS code, I have thiswhich sets a "cookie" to expire in 1 day. However, I want it to expire in 1 hour instead. Is there a way to do that?Code:var expiredays = "1";
Thanks :)
Here is a better look at more of the relevant code:
Code:function BookMark() {
$('#BookmarkImg').animate({ "top": "-81px" }, 1000);
baseCookieName = "rwbookmark";
var exdate = new Date();
var expiredays = "1";
exdate.setDate(exdate.getDate() + expiredays);
//use of arbritary stop point so no endless loop occurs
for (var i = 0; i < 10000; i++) {
var curName = baseCookieName + i;
if (document.cookie.indexOf(curName) < 0) {
document.cookie = curName + "=" + escape(window.location.href) + "[#]contentid=" + document.getElementById("inputContentID").value + "[#]title=" + GetPageTitle() + ";expires=" + exdate.toGMTString() + ";path=/;domain=domain.ca;";
break;
}
without looking at it too much, the first thing I would try is:
or something like thatCode:var expirehours = "1";
exdate.setDate(exdate.getHours() + expirehours);