Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+4)

I'm not familiar with cookies, but I would do it with localStorage instead. It's easier, but also more appropriate for this use case.

Something like this:

localStorage.setItem('currentLevel', 1);

var level = localStorage.getItem('currentLevel');

Wow! Thank you very much. This is an answer I wanted to find! Thank you. Appreciate your help!