I don’t know why I never got any responses to both my recent cookie/localStorage posts
www.sitepoint.com/community/t/localstorage-still-need-cookie-fallback-code/242567
www.sitepoint.com/community/t/cookie-local-storage-question/245156
but well, I’m hoping the third one’s the charm…
I’ve looked a lot into this issue, and my main concern now is: when cookies are turned off localStorage throws an error, and there’s apparently no contingency code you can deploy to prevent this… I find this bizarre, to say the least… and annoying…
and, not only that, but, if I’m in PHP env in my machine, when cookies are turned off, even if I have no localStorage or cookie code whatsoever in the page I’m loading I still see the localStorage error in the console… namely this error:
VM241:1982 Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
(VM241???)
this is too bizarre…
is there any way to prevent this error from occurring at all? I’m truly stumped here…
(as mentioned in my previous post aboout this, I don’t care if cookies/LS doesn’t work for a small percentage of users (I don’t send info that’s vital for the website to function, just user prefs, like language, color scheme, font-size), but I just don’t want this error thrown if cookies are disabled…
and, again, why does this error occur even if I don’t have any localStorage or cookie code on the page?? this is puzzling…
thank you…
=============
PS: I didn’t include whole paragr’s of mentioned threads at the top of this post, the system included those…