iPhone Safari localStorage does not persist after device reboot

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-14T20:18:57Z Indexed on 2010/04/14 20:23 UTC
Read the original article Hit count: 452

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.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about html5