Returning HTTP 401 status for AJAX responses without WWW-Authenticate
问题 Is it OK to return an HTTP 401 status for a response to an AJAX call if you wish to convey that the user is not logged in, even though the login mechanism is form-based and not HTTP based (Basic, Digest, etc.)? The answer here suggests that 401 should be used: https://stackoverflow.com/a/6937030/2891365 And this post shows an actual example of someone using 401 for an AJAX response: http://www.bennadel.com/blog/2228-some-thoughts-on-handling-401-unauthorized-errors-with-jquery.htm However,