PHP
·
发表于 5年以前
·
阅读量:8290
function setCookie(name, value, Hours) {
var d = new Date();
var offset = 8;
var utc = d.getTime() + d.getTimezoneOffset() * 60000;
var nd = utc + 3600000 * offset;
var exp = new Date(nd);
exp.setTime(exp.getTime() + Hours * 60 * 60 * 1000);
document.cookie =
name +
"=" +
escape(value) +
";path=/;expires=" +
exp.toGMTString() +
";domain=360doc.com;";
}