Instruct browser to only prompt for saving username/password when they have logged in successfully?

I noticed that some site would trigger the browser to prompt for saving username/password Only when they have logged in successfully. How to achieve that? response with HTTP 401 / 403 on error along side with the login form with error message?

Right now when I try logging in with invalid username/password, the server will redirect the browser back to the login form with some error message that indicates to the user that the username/password is incorrect, but the browser would ask if the client want to save the username/password which is inappropriate.

Thank you.

8
задан Henry 17 May 2011 в 17:46
поделиться