I am a newbie. I made a game. It works OK on the local server, but doesn't save the level number here (on ITCH). If you are familiar with this problem please help. Thank you.
PS Here are two functions
function getCookie(name) {
var cookie = " " + document.cookie;
var search = " " + name + "=";
var setStr = null;
var offset = 0;
var end = 0;
if (cookie.length > 0) {
offset = cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = cookie.indexOf(";", offset)
if (end == -1) {
end = cookie.length;
}
setStr = unescape(cookie.substring(offset, end));
}
}
return(setStr);
}
function setCookie (name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
// and implementation inside the game
var expires='Sun, 2-Sep-2119 06:31:50 GMT';
var path='';
var domain='';
var secure='';
var value=0;
level=level-0;
value=level+1;
setCookie (cook_name, value, expires, path, domain, secure);