The function I use sets the cookie expiration in this part of the code:
time += 3600 * 1000;
Expires in an hour. How to set this to expire after 10 years?
Well, how much:
Answer:
time += 3600 * 1000 * 24 * 365 * 10;
var CookieDate = new Date; CookieDate.setFullYear(CookieDate.getFullYear( ) +10); document.cookie = 'myCookie=to_be_deleted; expires=' + CookieDate.toGMTString( ) + ';';
This will
time += (3600 * 1000)*87660
8766 - the number of hours per year. Accurate measurement: 8,765.81277 hours