I believe this could be due to a Cross-site cookie issue, it appears that SameSite=None; Secure attribute is required now when setting cookies.
https://hacks.mozilla.org/2020/08/changes-to-samesite-cookie-behavior/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSitehttps://web.dev/samesite-cookie-recipes/Itch.io use an IFRAME so that could be causing the problem, to be honest, i've only just found out about this, so it's an interesting
issue you raised.
I tested your game via
https://v6p9d9t4.ssl.hwcdn.net/html/2709328/index.html - without IFRAME
then tested;
https://virtual-nomad.itch.io/p3 - with IFRAME
The p3scores cookie was saved with values 5000|4000|3000|2000|1000 without issue without the IFRAME, but was not saved when the game is called from the IFRAME.
You should be able to enable this behaviour in most browsers. If you use Chrome, you can type in chrome://flags/ in the address bar and I think you enable
SameSite by default cookiesand
Cookies without SameSite must be secureIf you find out any other info, workarounds etc.. Please post back, I'd like to learn more about this.
I'm not sure if you can set it from javascript, but a possible solution could be something like this:
If you look in HTML5Core.cpp, you may be able to add SameSite=None; Secure to the end of document.cookie, then rebuild agktier2.
+ Code Snippetvoid agk::SaveSharedVariable( const char *varName, const char *varValue )
{
EM_ASM_({
var cookieName = UTF8ToString($0);
var cookieValue = UTF8ToString($1);
var d = new Date();
d.setTime(d.getTime() + (5 * 365 * 24 * 60 * 60 * 1000)); // 5 years
var expires = "expires="+d.toUTCString();
document.cookie = cookieName + "=" + cookieValue + ";" + expires + ";path=/";
}, varName, varValue);
}
OR manually edit AGKPlayer.js and find:
+ Code Snippet document.cookie=cookieName+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"
Replace with:
+ Code Snippetdocument.cookie=cookieName+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; SameSite=None; Secure"
I'm not so sure that will work.