Cookie/local storage question

since I didn’t get a response to this question I decided to go ahead and do fallback cookie code to go along with my local storage code…

to test with just cookies I comment out local storage code… (i.e., I take out cond that starts with
if (!window.localStorage) and leave just the cookie code…)

but I wanted to test also with cookies DISABLED in the browser, as I know users can disable cookies, but I was under the impresion that users could not disable local storage… but it’s a bit more complicated than that…:wink: I kept getting local-storage-related errors when I disabled cookies, I didn’t know what was going on, till I searched for

when I turn off cookies get localstorage error

and found this (& the error I get is the same one shown here…)

so this means in effect that if a user disables cookies on their browser, they’re also disabling localstorage, yes? yikes…
(and that if they disable cookies then localstorage will throw an error… hmmm…)

conversely, in Chrome, if I turn on “block third-party cookies and site data” then local storage still works (“and site data” means local storage, I assume?), presumably b/c my localhost is not a “third party” site, yes? so how can I turn off local storage then? I just want to see if it will also throw an error if local storage is turned off (again, as mentioned, if I turn cookies off, local storage throws an error, I want to see if when I turn off local storage it will also throw a local-storage error…)

if I turn off cookies, cookie-code does not throw an error, only local storage throws an error…
(I turn off cookies with a Chrome extension (called “disable HTML”), it only turns off cookies, not local storage…)

I don’t care if with a small %ge of users local storage/cookies doesn’t work, I just don’t want any errors thrown if local storage is disabled… that’s why I need to test with ls disabled (and I also need to find out if this conditional
if (!window.localStorage)
will detect whether or not local storage is disabled or not…)

would appreciate suggestions…

thank you…

PS: I had the hardest time loging in, they made changes, and you had to login in again… I couldn’t log in b/c I had cookies turned off… (but it didn’t say anywhere that was the reason…:wink:

===========

this also just happened to me with another site, but it said, to pls turn on cookies, and presto! problem solved…
they need to fix this… users will not know why they can’t log in otherwise (I thought web dev 101 was you don’t store uid’s/pswds on cookies?? :wink: but well, just a comment…)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.