Demystifying cookies and tokens
tommihovi.com
tommihovi.com
I haven't needed to understand JWTs in depth, so have never spent the time to do a deep technical dive, but I'd still like to understand how they work. Every time I see a JWT article pass by, I'll jump in and find the general concepts explained but with enough technical gaps that I couldn't understand them in practical terms, especially when compared to my years of previous web-dev experience with cookies.
Also thanks to @unscaled for pointing out PASETO, which aims to fix some of the many problems with JWTs: https://paseto.io/
This claim is misguided, but I hear it quite often. JWT is a very popular (and downright terrible[1]) format, but I there is no evidence that most of the tokens use JWT. It could be worse - I've heard some people claiming with confidence that OAuth mandates JWT.
The reality is that OAuth 2.0 predates JWT, and the implicit assumption was that all tokens are stateful. The access tokens in the examples are all short, and the spec strongly recommends revoking access tokens in case of access code reuse.
This makes JWT access tokens a non-canonical implementation of OAuth 2.0. You could add a "jti" claim (or "uti" claim in case of Microsoft) and then check for revocations in Redis, but then your only achievement was bloating up your access tokens by a factor of 20. Congratulations!
That's the reason why the other Big Tech companies are not using JWT for Access Tokens. It just doesn't make sense when you are at the scale where you need access tokens to be small and moderately long-lived. Users of JWT are more heavily concentrated on the smaller scale: more recent startups and enterprise customers.
---
[1] https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-ba...
JWT isn't particularly useful for the smaller scale either: http://cryto.net/~joepie91/blog/2016/06/13/stop-using-jwt-fo...
The main argument seems to be vulnerability to attacker supplied JS (when kept in local storage). But if you're targeted by a supply chain attack, I assume you have a lot more to worry about than token exfiltration.
The complaint about lack of battle-tested JWT implementations seems outdated as well.
> We use cookies to ensure that we give you the best experience on our website.
> Accept | Decline
Do "non-essential" cookies actually make my experience any better? I always decline and haven't noticed a difference from the pre-GDPR days.
All this to avoid users just setting their browsers to discard cookies according to their wishes, an ability they’ve had for a decade or more.
I find these cookie banners twice as annoying as ads ever were.
It is a roundabout way of saying that “if you accept we will get some additional data that will influence our decision-making”. Which in turn could help prioritise bugs and features related to what you did when visiting the site.
On rare occasions, it can have direct influence, such as if you are searching for an ambiguous term we could forward the product categories you browsed recently to a third party search engine for different weights on the results. This actually has a positive effect with higher click-through on results, fewer searches, and click position nearer the top.
* There's no "Session" attribute -- (when no expires is set, it's a session cookie)
* session cookies deletion is misstated
* JWTs are just a possible format for OAuth, not a requirement
* incorrectly states that jwts are signed but not encrypted
This is really good advice and has bitten me in the past, I think as someone who is new to this it is tempting to avoid the term "Lax" but you might end up with some surprising behavior if you go with "Strict" as your default.
I also attempted to make sense of it all and created https://samesite.diduthink.com