Hacker News new | past | comments | ask | show | jobs | submit login

>> “ A mission critical user check needs to run (eg: does this user have enough money in their account to complete the transaction?)”

That info wouldn’t be in the session db row either.

>> “ A database write needs to occur to persist information (if this information is related to the user, it’s likely that the full user object must also be retrieved from the database”

This type of info doesn’t get updated frequently. Email, phone, name, etc, are pretty static. If they are just talking about a join using a userId, well that’s not gonna be any different whether you know the ID from a JWT or normal cookie.

>> “ The full user object must be pulled out of the cache / database so that the website can properly generate its dynamic page content”

But that’s an upside of keeping more than a cookie with an ID. You can just stash the stuff that doesn’t change much client side (keeping in mind the XSS risks). We certainly don’t pull the user’s email and name every page load even though it’s displayed on every page.

>> “ Almost every web framework loads the user on every incoming request. This includes frameworks like Django, Rails, Express.js”

That’s a framework issue and should be customizable. Not really a JWT vs cookie w/ ID topic

There’s plenty of reasons to choose an ID cookie vs a JWT but the many that the author gives are not among them.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: