It seems that cookie based authentication is the clear choice today for web services that require login credentials.
But what about if you're developing a web service where the clients are not browsers, but client software (such as a mobile App) that accesses resources via HTTP, would you use HTTP authentication or cookie authentication?
HTTP Auth:
- Web server handles authentication, so easier to change web app platform if needed
- Automatically applied to non-code resources (e.g. JPG, XML, etc) (Side Q: Is there a way to do this with cookie-based auth?)
- Harder to integrate database-stored credentials with server auth (.htaccess/.htpasswd)
Cookie Auth:
- Fine grained access controls (a code resource can respond differently based on credentials)
- Control over expiration of session (via cookie expirations)
- Full control over user login experience
What other considerations am I leaving out? Any other Pros/Cons?