Anonymous Asked in Cars &Transportation · 2 weeks ago

Is using localStorage Bad react?

11 мая 2020 г. · Dont use localStorage to store any sensitive information, if a site gets compromised, it can also compromise users computers using JS and .Is it a bad idea to use localStorage to store logged in user related .Local Storage vs Cookies [Authentication Tokens] : r/reactjs - RedditDifference between storing data in localStorage vs the state : r/reactjsWhat is the gold standard method of storing JWT in React . - RedditДругие результаты с сайта www.reddit.com


Is it bad practice to use localStorage?

Where cookies max at 4KB, LocalStorage can hold a lot of information. This can be a good and bad thing, depending on how you use it. There might be instances where you want to JSON. stringify() some data, however authorization tokens or user session data should never be used in localStorage, as it is not secure.

Is localStorage safe in react?

Local storage is vulnerable because it's easily accessible using JavaScript and an attacker can retrieve your access token and use it later. However, while httpOnly cookies are not accessible using JavaScript, this doesn't mean that by using cookies, you are safe from XSS attacks involving your access token.

Related Questions

Relevance
Write us your question, the answer will be received in 24 hours