Im working on a fullstack application with Node and React. I used to store the JWT in redux, so I could send it as a header with every request which should be authenticated. But recently I saw a video that said storing our JWT in redux/flux/mobx is vulnerable. How can this be vulnerable? The alternative approach he suggested was to send a cookie from the backend to the frontend with the token. So that it can be stored in the browser cookies. That way we don't have to send the token with every request.
Which approach is better here? What are the vulnerabilities of storing the token on redux?