Cookie trouble

so after tearing my hair out over a localStorage issue (if cookies are disabled localStorage throws an error that disables all other Javascript on the site; I found no solution to this) I decided I would chuck localStorage and only use cookies to store user prefs in the browser; but alas, am running into cookie problems… if I set only one cookie I have no problem, but with more than one cookie I run into problems, namely:

I set two cookies: 1) color-scheme pref; 2) language pref;

when user loads site for the first time no cookies are set, obviously; default values are loaded…

so I hit one of the pref cta’s (either lang or color-scheme pref); it changes from the default to the other value (there are only two options for each of the two prefs); I reload the page, the new pref is still on… so far so good…

but THEN I hit the other pref CTA… then when I reload the page, the SECOND PREF I CHANGED is preserved; HOWEVER: the FIRST PREF I HAD CHANGED BEFORE changes back to the default… it’s like one cookie is erased (or overwritten) when I change another pref… like the browser won’t remember two cookies; only one…

bare-bones fiddle:

(don’t see output in lower right window, don’t know why…)
(can’t load jQuery… I choose jQuery version (had to chose 1.9, I’m using 1.8 on my site), but when I reload it says “no library”… this bare-bones fiddle has some jQuery code, as it’s adapted from my website…)

would appreciate some help/suggestions…

thank you very much…

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