Question

I want a way of saving progress/values on my web page so when some one exits and comes back onto the web pages they wont lose anything. Say money for instance. I am creating a game and they earn money but if they exit and come back they will be reset back to 0.

I thought maybe cookies would be a good idea to save the values of variables? Also when they return to the web page it would need to detect the cookies and receive the values and set the variables accordantly.

how would I go about doing this, or is there an easier/better way?

Was it helpful?

Solution

Cookies can't hold much information. Sounds like you want to store more.

First have a look at local storage - sample here.

Or you can consider using lawndart which is an api built on top of indexeddb and websql (for Safari). Here is a tutorial about indexed db.

OTHER TIPS

polymer_elements for Dart offers this functionality too

  • polymer_cookie

or

  • polymer_localstorage
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top