Ask the browser to request only a username / password on successful login?

I noticed that some site will cause the browser to ask for the username / password to be saved only when they logged in successfully. How to do it? response from HTTP 401/403 to the error along with the login form with the error message?

Now, when I try to log in with an invalid username / password, the server will redirect the browser back to the login form with some error message that tells the user that the username / password is incorrect, but the browser asked if the client wants to save the username / password, which is inappropriate.

Thanks.

+7
source share
4 answers

You can write javascript to verify the credentials are correct, then if they submit the form.

Double entry, but the form will only be submitted if the credentials are correct.

+2
source

As far as I know, there is no standard way to do this, although the topic arises from time to time.

0
source

I would suggest that you can use JavaScript with PHP to check for the presence of the user, enter the correct password, then JS will also be used to display the check box in the form, or perhaps just ask them to save the login credentials. Let me know if that makes sense.

Now, I see, you are asking if you can disable the built-in browser request in this case. As much as possible, you can still follow my original idea and then use browser-specific code to disable this question. I'll see.

0
source

I think that at least Chrome does a small URL and a content check to see if the login was successful

0
source

All Articles