let name = 'abc';
let value = '123';
let exp = new Date();
exp.setTime(exp.getTime() + 60 * 1000);//过期时间 1分钟
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
console.log(name + "=" + escape(value) + ";expires=" + exp.toGMTString());