YUI set cookies expire sets different expire time in firefox and chrome

250 Views Asked by At

I want session to expire after a time period i.e 30 min. I am using YUI cookies utility for the task below is the function performing task for me.

function setCookies(staffid,sessionid) {
var currentDate = new Date();
var sessionPeriod = 1000 * 30 *60 ; //30 minutes of idle session is valid.
var timeOut = currentDate.getTime() + sessionPeriod;
alert(timeOut);
YAHOO.util.Cookie.set("_sid",staffid, {path : "/demo"});
YAHOO.util.Cookie.set("_uuid",sessionid, {path: "/demo", expires: new Date(timeOut)});
} 

Expire time set in Firefox and Chrome are different

Expire time set in Firefox was : 01 December 2012 14:30:28 Expire time set in Chrome was : Sat, 01 Dec 2012 09:00:31 GMT

Can anyone help me out in resolving the problem.

0

There are 0 best solutions below