Create Cookie and Delete old cookie using javascript
function SetCookie(id,text)
{
createCookie("ClientActiveTab","",-1);
createCookie("ClientSelectedTab","",-1);
var date = new Date();
createCookie("ClientActiveTab",id,1);
createCookie("ClientSelectedTab",text,1);
getSelectedTabFiles(text);
}
function createCookie(name,value,time)
{
if (time) {
var date = new Date();
date.setTime(date.getTime()+(time*24*60*60*1000)); // day 24 hrs
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
No comments:
Post a Comment