3 ms·
It's nuts to me that so many companies have moved off cookies for web app auth state. They're simple, they're well supported, they require very little work on t
by ryanbrunner 4y ago
It's nuts to me that so many companies have moved off cookies for web app auth state. They're simple, they're well supported, they require very little work on the browser side, and the abstractions around them on the server side are basically bulletproof at this point.
I see all this talk about authentication, and it's just literally never been a problem or concern for my company.
- treis 4y agoAren't JWTs just fancy cookies?
- freeqaz 4y agoJWTs are frequently stored in LocalStorage which means that any XSS is able to leak the JWT. Cookies, on the other hand, can be configured to be HTTP-Only and inaccessible to JavaScript on the page. That prevents somebody with XSS from leaking the value without a second server-side vulnerability or weakness. In addition, JWTs are impossible to revoke without revoking _all_ sessions. This is the biggest weakness, imo, and the reason that they shouldn't be used client-side. I'm a huge fan of the approach the Ory is taking with Oathkeeper and Kratos: https://www.ory.sh/docs/kratos/guides/zero-trust-iap-proxy-identity-access-proxy https://www.ory.sh/docs/kratos/guides/zero-trust-iap-proxy-i...
- ryanbrunner 4y agoSure, but browsers have done a lot of work to make cookies far more convenient (they're automatically sent with requests, you have browser APIs to work with them), and secure (Secure, HttpOnly, SameSite, etc.)
- nijave 4y agoCookies are a storage and transport mechanism and JWTs are signed JSON blobs. You could put a JWT inside a cookie.