HN Hall of Fame Weekly email

Stop using JWT for sessions (2016)

Screenshot of cryto.net captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 7 calendar years, with breakout response in 2 of them.

submissions
11
submitters
11
observed span
2016–2024
peak thread · 245 comments
248 pts
latest 20+ return · 2018-11-01
248 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

Top reason for me always was : > You cannot invalidate individual JWT tokens And there are more security problems. Unlike sessions - which can be invalidated by the server whenever it feels like it - individual stateless JWT tokens cannot be invalidated. By design, they will be valid until they expire, no matter what happens. This means that you cannot, for example, invalidate the session of an attacker after detecting a compromise. You also cannot invalidate old sessions when…

You cannot invalidate JWT tokens This is simple not true. You ALWAYS will sign your tokens with a well known secret, you could eventually even add some salt from a database to it. They are less secure Compared to what? Actually JWT will have the same secureness like Bearer Tokens or Cookies, wherever you store it, its not `less` secure. Horrible article points here. They are less secure They take the same amount of storage than signed cookies, wuhu I…

merb·226-point thread·

Terrible, Terrible advice. Here's an actual quote from the article: "...unless you are operating at the size of Reddit, you will not need 'stateless sessions'." So for the rest of 99% of the technology world, you don't need stateless session because TFA says so.

Eh, disagree. For space, you can use ellipic curve instead of RSA to halve the size of your token. Sticky sessions are really hard or impossible on public clouds where you can't load balance by ip/port hash. And still hard when you consider that mobile devices hop on and off wifi constantly. One of the worst, shittiest third parties we use has IP based sticky sessions and it's utterly broken because we run 3 instances in different AZ's for HA…

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
533

reference only — not used in Hall rules or ranking

Total comments
403

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2016-06-13Don't use JSON web tokens for sessionsFirst breakoutjoepie91_226147
2017-10-11Stop using JWT for sessionssetra203
2018-02-15Stop using JWT for sessionsIllotus20
2018-08-30Stop Using JWT for Sessionshyperpape20
2018-11-01Stop using JWT for sessions (2016)Hall induction · Best thread · Latest 20+ point returnenraged_camel248245
2020-09-21Stop using JWT for sessions (2016)tosh20
2021-07-04Stop Using JWT for Sessions (2016)manjana156
2022-10-03Stop using JWT for sessions (2016)michidk30
2022-12-28Stop Using JWT for Sessionssatvikpendem10
2024-05-28Stop Using JWT for Sessionsllambda41
2024-06-07Stop Using JWT for Sessionskhanmitdoit101