← All postsEngineering

Auth done right: sessions, tokens, and the middle path

Sep 2026·8 min read

Every few months the internet rediscovers the JWT vs session debate and everyone picks a tribe. I've shipped both, broken both in a pentest, and landed on the answer that matters more than the token format: rotation, revocation, and scope.

The debate is a distraction

Stateless JWTs scale beautifully — until you need to revoke one. Server sessions revoke instantly — until you're juggling infrastructure across regions. Both models are fine. Both models are terrible when tokens live for 30 days and never rotate.

The middle path I actually ship

Logout means logout. If your design can't guarantee that, redesign it.

The part your users will actually notice

Good auth is invisible — until it matters. Re-auth before dangerous actions feels like a bank doing its job. Instant logout on a stolen-device report feels like being taken seriously. None of this requires JWT or sessions specifically. It requires deciding that revocation is a feature, not an afterthought.

Rule of thumb: if you can't answer "how do I revoke this token right now?" in one sentence, your auth isn't done.
Get in touch →