WWW FAQs: What does 401 Unauthorized mean?

2007-05-16: 401 Unauthorized (sometimes mislabeled as 401 Forbidden) is the HTTP status code produced by a web server when you don't have the right credentials to access the page or file you have asked for. The web server sends your browser the 401 Unauthorized response when you access a password-protected page without presenting a password. Normally the web browser automatically recognizes this situation and displays a password prompt at this point. However, if you don't know the correct username and password and click "Cancel" rather than trying again, the browser may show you the 401 Unauthorized error message directly.

For a complete list of standard HTTP status codes, see the W3 Consortium's website.

Legal Note: yes, you may use sample HTML, Javascript, PHP and other code presented above in your own projects. You may not reproduce large portions of the text of the article without our express permission.

Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!