Here is my code:
sessionStorage.loggedIn = true;
if (sessionStorage.loggedIn) {
alert(\'true\');
}
else {
alert(\'false\');
Keys and Values in a WebStorage object (sessionStorage) must be strings. If they are not strings they "should" be converted to strings in the browser's implementation when you assign to sessionStorage. If you evaluate against "true" or convert to boolean it will work fine.
https://code.google.com/p/sessionstorage/
http://www.w3schools.com/html/html5_webstorage.asp