DEV Community

Discussion on: What Happens If Your JWT Is Stolen?

Collapse
 
kspeakman profile image
Kasey Speakman

Oh I totally understand needing to be able to share the token across subdomains. It helps with deployment flexibility.

One note of caution though. I realized later that what I described at the end (putting the JWT in a cookie) opens itself up to XSRF attacks unless other precautions are taken. Common ones are anti-forgery tokens (which requires keeping some session state) or using CORS with appropriate Origin restrictions.

Thread Thread
 
vicxxx profile image
VicXXX

Yeah we do that already and actually upgrading platform to stop relying on the client generated cookies and switching to http only