When you say
meant to be stored locally
Do you mean you are currently just testing via mobile safari? If so then naturally the state will be remembered. Closing safari on the iphone is comparable to minimizing your browser on a desktop. Provided there is memory free the process is held in the background.
Were you to package it up into a standalone process via phonegap or alike then you wouldn't see this behavior anymore as the memory is flushed automatically upon quit.
If you want to leave it as a web based app then having it hold it's state unless refreshed would be the expected behavior.
Adding the app to your home-screen also flushes the memory as far as I remember.
The only way I know to refresh the sate in the native safari would be via window.location.reload()
. The problem with this is there is no way to know when to call this. You could listen for window focus but that would fire if you switched between tabs for example - which could be very frustrating.