Currently Being ModeratedMar 25, 2012 2:23 PM (in response to aesculus)
It appears that this is a direct violation of the standards set forth in HTML5.
The second use case pertains to using HTML5 local storage between sessions.
Currently Being ModeratedMar 25, 2012 4:31 PM (in response to etresoft)
About half way down the page:
The second storage mechanism is designed for storage that spans multiple windows, and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.
Again, cookies do not handle this case well, because they are transmitted with every request.
The localStorage IDL attribute is used to access a page's local storage area.
So who is the 'user' in this case? Apple or the programmer?
Currently Being ModeratedMar 25, 2012 5:08 PM (in response to aesculus)
That is from the introduction, which explicity says "This section is non-normative". That means it is just an example. Nothing in it should be considered part of the standard.
The idea behind local storage is to make the web site run more quickly because it doesn't have to exchange everything between the client and server with every request. But if the user switches to some other program or site, or quits the web browser, all bets are off. It is the web site's responsibility to upload any local changes to the server. Generally, you will have a login and a logout procedure that will synchronize data. You can't assume the data is always there. Consider the use case of interacting with a web site and then switching to a different machine or device. In that case, you want to be able to pick up where you left off. Ergo, your site cannot assume that any local data will be available. It needs to be able to initialize its state from nothing and it must save state before going idle.
Currently Being ModeratedMar 25, 2012 5:42 PM (in response to etresoft)
Well then what about this statement from Apples own development site?
Currently Being ModeratedMar 25, 2012 7:14 PM (in response to aesculus)
This seems to be primarily a problem with the PhoneGap library. This post has the best description of the problem and some suggested solutions. Basically, it is now the responsibility of each webkit application to save its local web storage.
Currently Being ModeratedJul 22, 2012 11:35 AM (in response to aesculus)
How about if I am not using native app and webkit, but actually building an iphone Ipad website in HTML5, which will be accessed through Safari web browser? Using localstorage of HTML 5 will still be an issue?
Currently Being ModeratedJul 22, 2012 11:46 AM (in response to alok_bunty2002)
Thats my domain and it will randomly wipe out your DB with the 5.1x version of iOS. I don't use PhoneGap. The PhoneGap references were a workaround for people using that platform only.
Currently Being ModeratedJul 22, 2012 11:59 AM (in response to aesculus)
I am not using phonegap either. Mine is simple html5 website which uses localStorage of HTML5 and I was hoping that users could use this html5 web ui in their browser and the browser could store data in a persistant mode in localStorage. So, what you are saying that ios 5.1 or above(5.1.1) will randomly wipe out?
Currently Being ModeratedJul 22, 2012 12:10 PM (in response to alok_bunty2002)
But what if someone accesses your web site from a different computer? Where is their data? Local storage is cache. If a user logs into your web site and has local data, everything should load quickly. If they don't have local data then it is your responsibility to initialize it from your server. When your application runs, it uses local storage. At logout or after an idle period it should flush changes to the server.
Currently Being ModeratedJul 22, 2012 12:18 PM (in response to etresoft)
No thats not what "localStorage" is for as per HTML5. Please see link https://developer.apple.com/library/safari/#documentation/iPhone/Conceptual/Safa riJSDatabaseGuide/Name-ValueStorage/Name-ValueStorage.html#//apple_ref/doc/uid/T P40007256-CH6-SW1 and read key-value pair for details on localStorage. Its meant for persistance but ios5.1 webkit is in violation of this feature of html 5. I was wondering if safari browser on ios5.1 also has the same violation or this violation is restricted to only webkit.
Currently Being ModeratedJul 22, 2012 1:48 PM (in response to alok_bunty2002)
No thats not what "localStorage" is for as per HTML5.
That is not a standards document. This is: http://www.whatwg.org/specs/web-apps/current-work/multipage/
Take a look at section 11.2.3 where it reads:
User agents should expire data from the local storage areas only for security reasons or when requested to do so by the user.
Not only is your local storage never guaranteed, it can be deleted at any time by the user. It is a cache meant for a web app to be used offline.