Cookies vs Basic Auth

后端 未结 3 1293
囚心锁ツ
囚心锁ツ 2020-12-08 20:22

Why almost all websites out there are using cookies instead of basic auth? It can\'t be only that the user/pass window is ugly and none of them is more secure. They are both

3条回答
  •  抹茶落季
    2020-12-08 21:03

    With cookies you have the complete control on when to authenticate the user, its not as soon as theres a request.

    Plus you dont have to authenticate for pictures as well

    Another thing is that you dont have to rely on a sysadmin for auth.

    You also have the choice regarding the users repository with session.

    There are other things. As you said, both are more or less secure so why not opt with flexibility? To showcase sites to clients we often use server auth as it is easy and a global solution.. for forms within apps, we use cookies.

提交回复
热议问题