Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is localStorage reliable on an iPad?

I'm seeing a few comments from people suggesting that localStorage on an iPad is unreliable. Can anyone confirm that they are happily using localStorage on an iPad? I understand that there is a 5Mb limit too - is that still the case?

Thanks

like image 357
Journeyman Avatar asked May 04 '11 17:05

Journeyman


People also ask

Does LocalStorage work on iOS?

localStorage works on desktop but not mobile (iOS version 12.2)

Does Safari have LocalStorage?

In Safari, you can find Local Storage by first going to the Develop menu, then choosing Show Web Inspector, selecting the Storage tab and then selecting Local Storage from the side menu.

Does local storage works in mobile?

Nowadays, through the use of LocalStorage, we can store data on clients like browsers and mobile apps without communicating with a back-end application. In this article, we will discuss how developers can store data on the client with cookies and how LocalStorage improved that experience.

Does local storage last forever?

LocalStorage has no expiration time, Data in the LocalStorage persist till the user manually delete it. This is the only difference between LocalStorage and SessionStorage.


1 Answers

I've been working on a project that uses localStorage on an iPad. In my experience, the localStorage is perfectly stable. However, there are two things to consider:

  • Yes, the storage-limit is still 5Mb. Since characters are stored UTF16, only 2.5M characters can be stored in localStorage.

  • In contrast to other localStorage implementations, localStorage.setItem() doesn't delete any previous items with the same key before storing the new item. In other words: When overwriting an item, one should always call localStorage.removeItem() before calling localStorage.setItem(), or you'll quickly run out of space.

like image 58
TinkerTank Avatar answered Dec 21 '22 07:12

TinkerTank