this post was submitted on 12 Dec 2023
249 points (96.3% liked)

Programmer Humor

31998 readers
947 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 52 points 9 months ago (7 children)

...so allow...either?

What's so hard about checking two headers (Authorization: and Cookie:) for the authtoken?

[–] [email protected] 33 points 9 months ago (6 children)

It's a security thing. The HttpOnly cookie can't be stolen using XSS or something like that, while a bearer token must be stored somewhere where javascript can see it.

[–] [email protected] 25 points 9 months ago

Then again, cookie auth is vulnerable to CSRF. Pick your poison.

Although CSRF protection just adds a minor inconvenience, while there is never a guarantee your code is XSS vulnerability free.

load more comments (5 replies)
load more comments (5 replies)