Clear localStorage on iOS Safari

How can you clear all localStorage from iOS Safari? Selecting "Clear website history and data" does not delete localStorage (which seems strange, maybe an error?).

A similar question was asked to apple.stackexchange.com , but it was closed.

I recorded a video showing a problem in the iOS9.1 simulator.

+5
source share
3 answers

From Apple Support :

To clear other saved information from Safari, go to Settings> Safari> Advanced> Website Data> Delete All Website Data.

Or, if you want to delete it for a specific site, you can either move the entry to the left, or delete it, or click the right button in the upper left corner and delete everything that you have.

+4
source

So, as you can see, some browsers are more stubborn about storing local storage than others. The only thing you can do is clear the repository using the local API.

localStorage.clear() //clears everything in localStorage localStorage.removeItem("test123") //removes only the specific property "test123" 

I wrote an article about localStorage that explains some of the nuances: http://www.richfinelli.com/local-storage-101/

I am not sure how to clean it manually in iOS.

+3
source

You need to clean the corresponding db files in / Library / Safari / Databases and / Library / Safari / LocalStorage

Open Finder on your Mac and press GO and Go to Folder and paste the two locations above.

Delete the files with the names of the applications whose data you want to clear.

0
source

Source: https://habr.com/ru/post/1240677/


All Articles