79459895

Date: 2025-02-22 16:13:33
Score: 7.5 🚩
Natty:
Report link

@Manish Kumar Thanks sir,So, should I store the JWT token in a cookie and then request the token from the cookie whenever I need to check permissions using various variables? Then, extract variables like user.role and userID from the token?

Right now, my website is trying to reduce API calls. When a user logs in for the first time, I store all the important variables, including the token, in localStorage. If I were to switch to using cookies instead, how should I implement the other variables correctly according to best practices?

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (1): how should I
  • Long answer (-0.5):
  • No code block (0.5):
  • Ends in question mark (2):
  • User mentioned (1): @Manish
  • Self-answer (0.5):
  • Looks like a comment (1):
  • Low reputation (1):
Posted by: Nattadon Supachoksirirat