I am using local storage to store credentials and login details. It is working fine but when i tried to change that value it is not changing.

Here is the code for login.

**login.html**

```
 <script type="text/javascript">

                window.localStorage.setItem("login", "true");
                window.localStorage.setItem("email", data.email);
                window.localStorage.setItem("id", data.uid);    
                window.localStorage.setItem("name", data.name);                                 

</script> 

```

and here is the code for logout. This one not working.

**logout.html**

```
window.localStorage.setItem("login", "false");

```

For some reason i am always getting `login = true` in logout.html file.

Any advise what am i doing wrong.

**Edit:**

Nothing wrong with the code. It is working fine. I was accessing the file directly thats why it was not changing.