Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do tell a browser not to offer to save an incorrect password?

Often on a website, if I enter the wrong password by mistake, I get a page back that indicates the wrong credentials, but Chrome (Or whatever) prompts me with "Would you like to remember this password?"

Is there any way to hint to the browser that now is not the time to ask, so that it only prompts if the user enters a correct password?

like image 344
izb Avatar asked Dec 02 '11 18:12

izb


People also ask

How do I stop my browser from asking to save passwords?

Method 1: One of the known methods is to use autocomplete attribute to prevent browser to remember the password. In the input field, if we define autocomplete=”off” then many times the input value is not remembered by the browser.

Why you should never allow your web browser to save your passwords?

The Browser Security RiskThis database of passwords stored in your browser is not as secure as you might think. Depending on the browser, if hackers gained access to your computer, they could actually extract the contents of the database – and get access to ALL your private logins.

Why does Google not offer to save password?

If Chrome doesn't offer to save the password, make sure that the password-saving feature is actually enabled. To check this, go to Settings > Autofill > Passwords. If the Offer to save passwords option is switched off, toggle it on. Now, Chrome will offer you to save passwords when you log in to any website.

Why You Should Never save passwords on Chrome?

Experts warn against storing passwords in Chrome after hackers target remote workers. Hackers are preying on people working from home for passwords stored in web browsers, experts claim. Keeping passwords saved in the likes of Chrome and Edge is pretty common practice and usually considered quite safe.


1 Answers

You could use JQuery & Ajax to post the login form to the server and recieve a response back without ever reloading the page, thus avoiding this problem altogether.

EDIT

Something along the lines of this (untested):

<div id="error"></div>
<form id="loginForm" method="post">
  <input type="username" name="username" id="username">
  <input type="password" name="password" id="password">
  <input type="submit" value="Login">
</form>

<script>
  $(function(){
   $('#loginForm').submit(function(){
     // Ajax to check username/pass
    $.ajax({
      type: "POST"
    , url: "/login"
    , data: {
        username: $('#username').val()
      , password: $('#password').val()
      }
    , success: function(response) {
        if(response == 'OK'){
          $('#loginForm').submit()
        } else {
          $('#error').html('Invalid username or password')
        }
      }
   })
  })
</script>
like image 64
Pastor Bones Avatar answered Sep 19 '22 19:09

Pastor Bones