Is it safe to store a jwt in localStorage with reactjs?
问题 I'm currently building a single page application using reactjs. I read that many of the reasons for not using localStorage is because of XSS vulnerabilities. Since React escapes all user input, would it now be safe to use localStorage? 回答1: In most of the modern single page applications, we indeed have to store the token somewhere on the client side (most common use case - to keep the user logged in after a page refresh). There are a total of 2 options available: Web Storage (session storage,