how do I set cookies so the levels can be unlocked
Use the WebStorage plugin to save local values.
Develop games in your browser. Powerful, performant & highly capable.
No cookies needed. Web Storage will persist settings. Though, I hear depending on the platform it may get wiped if they do a cache deletion... not sure though.