3

This question has been posted before, and I've tried following several different methods to try to get this working, but it won't. On login I need to post to a php form. If that PHP form succeeds, it changes the header location to redirect the user into the site. But Chrome will not prompt to save the users login information.

I've read about how Chrome seems to look for an input[type=password][name=password], input[type=text][name=username]. And I've tried using an input[type=submit] and button with button.submit() attached to it. But neither work.

Code looks something like this:

<form id='loginForm' name='loginForm' action='/scripts/login.php' method='post'>
 <input type='text' name='username' id='username' placeholder='Username' maxlength='30' autofocus required><br/>
 <input type='password' name='password' id='password' placeholder='Password' maxlength='64' required><br/>
 <button type='button' name='login' id='loginButton'>Login</button>
</form>

<script>
 $('#loginButton').click(function(){
   $('#loginForm').submit();
 });
</script>

Then login.php does the authentication needed and changes the header location:

header('Location: /pages/index.php');

Throughout I never get Chrome asking to save my user credentials. Any thoughts? Thanks.

I've tried the following already:

remember passowrd works in ff but not in ie and chrome

HTML: Chrome save password

How can I get browser to prompt to save password?

Community
  • 1
  • 1
Alex
  • 90
  • 1
  • 9
  • My guess would be the prompt appears on `scripts/login.php` but since you redirect you never see it. – chris85 Sep 06 '16 at 18:12
  • Kind of what I assumed too. No idea how to work around that (short of migrating the various landing pages I change the header location into one file with a bunch of ifs to check what to display to the user)? – Alex Sep 07 '16 at 13:21
  • You could send the validation request via AJAX. – chris85 Sep 07 '16 at 14:32

0 Answers0