Upgrading an iOS 5.1 app renders security errors in using UIWebView localStorage and WebSQL
Upgrading an iOS 5.1 app to a newer version breaks apps that use localStorage and WebSQL, there is an error in the console:
deny file-write-create /private/var/mobile/Applications/[GUID]
Steps to to reproduce:
In a UIWebView, create a new DB or use localStorage
Overwrite / update your app and open the same database or write to localStorage.
We should see the data from the database and localStorage.
Call to window.openDatabase fails with "SECURITY_ERR: DOM Exception 18"
Call to localStorage.setItem fails silently
It appears that on an app upgrade in iOS 5.1, the app's GUID folder has been moved/renamed, BUT the Webkit keys in the plist in the apps' Library/Preferences/[CFBundleIdentifier].plist refer to the OLD GUID location
To fix, on an app upgrade when you change the GUID of the app folder, you should update the Webkit keys as well from the plist mentioned above.
Discussion at these links below as well.
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!