JWT access + refresh token rotation (conceptual)

14396
0

A single long-lived JWT is a liability: if it leaks, it’s valid until it expires and revocation is hard. I use short-lived access tokens and longer-lived refresh tokens, and I rotate refresh tokens on every use. Rotation means that if an attacker steals a refresh token and tries to reuse it, you can detect the replay and invalidate the session. The key is storing refresh token hashes server-side (not the raw token) and binding them to a session record. This pattern is more work than simple JWTs, but it gives you a practical revocation story without building a full server-side session store for access tokens.