function setCookie(name, value, expires, path, domain, secure){
var cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);
if(expires) cookie += '; expires=' + expires.toGMTString();
if(path) cookie += '; path=' + path;
if(domain) cookie += '; domain=' + domain;
if(secure) cookie += '; secure=' + secure;
document.cookie = cookie;
}
function removeCookie(name, path, domain){
document.cookie = name + '=' +
'; path=' + path +
'; domain=' + domain +
'; max-age=0';
}
喵喔喔
相关分类