Here is my code:
sessionStorage.loggedIn = true;
if (sessionStorage.loggedIn) {
alert('true');
}
else {
alert('false');
}
Simple enough. There must be some small thing I'm not understanding about how JavaScript is evaluating these expressions. When I put sessionStorage.loggedIn = false
, the "false" alert shows correctly. However, when I change sessionStorage.loggedIn
to true, the "false" alert still pops, even after clearing the session. What am I not getting right with this expression? It seems so simple, maybe I just need another pair of eyes on it.