|
|
|
|
|
by oopsthrowpass
936 days ago
|
|
In my opinion there are 2 good approaches: If you really need to use JWT-s then store the refresh (just normal UUID looking token that is validated on the backend) token in a httpOnly cookie and JWT in local/session storage, use 10-15 minutes expiration and you are somewhat OK on logout= (the XSS is still maybe exploitable). On logout make sure to invalidate the refresh token. In my opinion a better way is to just use a good old encrypted/signed/httpOnly/sameSite UUID=123 cookie, convert that to a JWT in your APIGW/BFF when talking to backends. I would not try to cram JWT-s into cookies they are too big, but maybe these days nobody cares about the extra bytes |
|
Why does the length matter compared to when they are sent with cookies or with a special header?