Cookies vs Basic Auth

loxs picture loxs · Feb 19, 2011 · Viewed 14.8k times · Source

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 insecure (without https).

Answer

Andrew Marshall picture Andrew Marshall · Feb 19, 2011

To logout of a basic auth login the browser often needs to be quit entirely. This means there is no way for the server to log out the user.

I believe basic auth also has more overhead (assuming your cookie size isn't massive), but I might be wrong about that.

HTTP basic auth also sends the username and password with every request, making it potentially less secure because there is more opportunity for interception.