Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Security Error on iPhone when using localStorage

When I try saving anything with localStorage.setItem(""); in IOS Safari, I get this error -

SecurityError (DOM Exception 18): The operation is insecure.

Here is a screenshot of the error...

enter image description here

Any ideas how to fix this? Thanks.

like image 684
nachshon f Avatar asked Dec 19 '22 03:12

nachshon f


2 Answers

Found the answer. Block Cookies was turned on in the users Safari Settings.

like image 137
nachshon f Avatar answered Dec 24 '22 00:12

nachshon f


I had this problem on the desktop version of Safari. I enabled "Disable Local File Restrictions" This is how you can find it:

where to find "disable local file restrictions" in desktop safari

Your cookie settings are also not allowed to be on "Always block". Otherwise you also get this error!

like image 35
maracuja-juice Avatar answered Dec 24 '22 01:12

maracuja-juice