Hi All
I have a page that displays data which is read from a cookie. The cookie expires after an hour. Frequently, a user will navigate to the page and keep it open. When they come back to it later, the cookie has expired and the data on the page is no longer relevant.
Can anyone suggest how I can set the cookie's expiration time to last the length of the session?
For reference, this is the code I'm using to set the cookie (which I lifted from another project we have, and which may in turn have been lifted from this site! :-)
function setCookie(value)
{
var today = new Date();
today.setTime(today.getTime());
var expires = 30 * 1000 * 60;
var c_name = 'CompareFundIds';
var exdate = new Date(today.getTime() + (expires));
document.cookie = c_name + "=" + value + ";expires=" + exdate.toGMTString();
}
Thanks Guys,
Dave