iPhone Safari localStorage does not persist after device reboot
- by Tom
Hi,
I write a simple iPhone web app using HTML5's localStorage.
Tests on a 2G device show the data does not persist after an iPhone reboot.
This is a test code:
<html>
<head>
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body>
<script>
alert("1:" + localStorage.getItem("test"));
localStorage.setItem("test", "123");
alert("2:" + localStorage.getItem("test"));
</script>
</body>
As far as I understand the data should persist even after a device reboot.
Can anyone shed some light on this behavior?
Thanks!
Tom.