I have a problem where the value of the localStorage item won't get saved.
I have no idea why, it's fine untill I refresh.
The variable / local storage item is "logged".
Here is my code :
HTML and JavaScript
In my opinion, at the beginning of the javascript code, you have to store and retrieve local storage for 'logged' by checking if it exists or not:
if(localStorage.getItem("logged") !== undefined) {
logged = localStorage.getItem("logged");
}
else {
localStorage.setItem("logged", logged);
}