我似乎无法正确设置cookie,或者我可能没有正确阅读它。
alert(m)= name=Player; pl={"inf":0,"pop":0,"empty":{}}; expires=Thu, 01 Jan 2015 00:00:01 GMT; path=/;
提醒(cs)= name=Player ?
不确定为什么cs不等于m
save: function(){
//erase cookies
document.cookie = 'name=Player; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
var pl = "pl=" + JSON.stringify( this.player.getAsJSON() );
var ex = "expires=Thu, 01 Jan 2015 00:00:01 GMT";
var path = "path=/";
var m = "name=Player; " + pl + "; " + ex + "; " + path + "; ";
alert(m);
//create new cookie
document.cookie = m;
},
getSave: function(){
var cs = document.cookie;
alert( cs );
/*var parts = cs.split("; ");*/
}