mercredi 23 décembre 2020

sessionStorage in Firefox with lokal html

I have a problem using session- or local-storage on my website when opening the html locally with Firefox. The same code works on Chrome, so i think it´s up to Firefox.

Setting a sessionStorage item with sessionStorage.setItem("cookiesEnabled", "1") and reading it with sessionStorage.getItem("cookiesEnabled") works, even after refreshing the page. But after navigating to another html via an anchor <a href="./html/login.html">Login</a>, the sessionStorage is empty. Going back to the first page the value is still set.

Strangely, it works when I move the html from the subfolder to the same folder as the first one - so both HTML files are in the same folder.

Has anybody an idea how to solve this, without moving all my htmls to one folder?

Thanks




Aucun commentaire:

Enregistrer un commentaire