0

I need advice, what is the best way to store a JWT token? Should we store in cookies or storages? But with the CSRF flaw and xss attacks I have a doubt. I'm still in training and working on a year-end project. Or the best is to store the jwt token in a variable in a store. I developed the application in nodejs express js for the back and in react for the frontend. Thanks in advance for your advice.

tony
  • 199
  • 4
  • 15

1 Answers1

0

I use cookies, they are easily able to be accessed server side and can have an expiration date.

Take a look at this post: Local Storage vs Cookies