Menu

How to Choose Node.js Web Sessions — Opaque Revocation vs JWT Statelessness
📰

How to Choose Node.js Web Sessions — Opaque Revocation vs JWT Statelessness

DEV Community: authentication·LinusHolm3764·about 6 hours ago
#lOelkS7G
Long article (2450 words) — no AI summary yet.
Reading 0:00
15s threshold

A player banned during a match should lose access on the next protected request. For a gaming web app migrating off managed authentication, that requirement favors an opaque session over a locally validated JWT. Moving Google and GitHub sign-in is only part of the job. The game also needs control over the sessions those sign-ins create.

TL;DR: use opaque sessions for this browser app when the server must check current access on every request. Choose locally validated JWTs when avoiding that lookup matters more than immediate revocation, and define how long stale access is acceptable. Adding a revocation lookup to a JWT can be reasonable, but it gives up the purely stateless request path.

Keep identity stable.

This build log works through a migration rehearsal: preserve player IDs, create a small local session boundary, prove that logout invalidates a credential, and measure the lookup before distributing it. The code is an executable, single-process model.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.