---
title: "Comment by Apoorv Tyagi on \"How to Save User's Data Persistently in Web Browser Using Local Storage\" | Hashnode"
description: "Is it possible if I get someone&#39;s auth token from their local storage and add it to my browser&#39;s local storage? Will that token work for me? For example"
url: "https://hashnode.com/posts/local-storage-in-javascript/616fdd000c5e175a1c610c54/comment/617009c3d78c655a23127ff6"
---

[Discussion](https://hashnode.com/posts/local-storage-in-javascript/616fdd000c5e175a1c610c54)

Comment [How to Save User's Data Persistently in Web Browser Using Local Storage](https://hashnode.com/posts/local-storage-in-javascript/616fdd000c5e175a1c610c54)

[Oct 20, 2021](https://hashnode.com/posts/local-storage-in-javascript/616fdd000c5e175a1c610c54/comment/617009c3d78c655a23127ff6)

Is it possible if I get someone's auth token from their local storage and add it to my browser's local storage? Will that token work for me? For example, If I store the login token for each user in the local storage but let's say someone got access to that token, can they then login using that token from their own browser?

Basically, how does the browser ensures the security of data?

[Yuvraj Singh Jadon](https://hashnode.com/@yuvraajsj18)

[Oct 20, 2021](https://hashnode.com/posts/local-storage-in-javascript/616fdd000c5e175a1c610c54/comment/617009c3d78c655a23127ff6#reply-61705be90c5e175a1c6118ef)

Yes, once a token is stolen the account would be compromised. That's why sensitive information must never be stored in local storage as browser doesn't ensure any security. Any third party js code used on the website can access local storage thus increasing the chances of token theft.

Will also update the article to include this point. Thanks for pointing it out. 🙌🙌

Also [developer.okta.com/blog/2018/06/20/what-happens-i…](https://developer.okta.com/blog/2018/06/20/what-happens-if-your-jwt-is-stolen) this is a brilliant article about the same. Worth a read.

[Apoorv Tyagi](https://hashnode.com/@apoorvtyagi)

[Oct 24, 2021](https://hashnode.com/posts/local-storage-in-javascript/616fdd000c5e175a1c610c54/comment/617009c3d78c655a23127ff6#reply-6175901c0f452c1cd94fb8be)

[Yuvraj Singh Jadon](https://hashnode.com/@yuvraajsj18) Thanks for the answer.
