views:

104

answers:

4

What do you need to do on a login form so that the browser prompts to remember the login information? I have a input named "username" and one named "password".

on my browser i have it set to ask if it should remember the password, and it does on most sites, but on the site that i am testing it doesnt, so i am wondering what can be changed to make it remember.

i am also using the type=password for the password field, and it logs in fine and everything, but neither firefox, or safari want to remember it. it is not a huge problem, but it would be nice to figure out

Thanks

here is the form:

<form id="login" method="post" action="/login.php">
<div class="cell">

<div class="left">Username: </div>
<div class="right">
<input type="text" id="username" name="username">
</div>

<div class="left">Password: </div>
<div class="right">
<input type="password" id="password" name="password">
</div>

<div class="left"></div>
<div class="right">
<input type="submit" value="Log In" />
</div>

<div class="clear"></div>
</div>
</form>

+4  A: 

Make sure your input is type="password". If its type is text, it won't work.

Brendan Long
Exactly. It doesn't matter what the fields are called, as long as one of them is a password field it'll trigger the remember-password prompt (at least in FF).
Chris Pebble
I have an input of type password in my website and firefox never asks me either. My site is still under construction though, so when you login, the next request still shows the login form, and then the request after it will figure out that your logged in and not display the form. Maybe if the form is shown after trying to login has something to do with it? (firefox detects it as a "wrong password" and so won't try to remember it)
Earlz
@Earlz, it sounds like whatever function is telling it that you're logged in is happening after the form is displayed.
Brendan Long
@Brendan Well, yea, that's part of the WIP bit. lol.
Earlz
A: 

Usualy nothing... Browser take care of that. There is a attribute in HTML to tell browser NOT to remember

autocomplete=off
confiq
He *wants* the browser to remember them, read the question more carefully.
animuson
on my browser i have it set to ask if it should remember the password, and it does on most sites, but on the site that i am testing it doesnt, so i am wondering what can be changed to make it remember.
MILESMIBALERR
I did read it, and answer it in first 2 words!
confiq
@animuson: read his answer more carefully. He did answer the question...and then provided some extra detail which, while tangential, could still be useful.
Beska
@milesmibaleer: Good info! Add that to your question...it helps!
Beska
"Usually nothing" does not answer the question. There are things you have to do to get the browser to send the prompt, as explained in the accepted answer of the question I linked to. While they may be simple tasks to accomplish, they are things that must be done.
animuson
But password inputs 'always' should have type=password. It's obvious. anyway, doesn't matter, if answer was not useful for you then leave your vote that way!
confiq
And as you see in his edited question, there is type=password ... blah...
confiq
A: 

Firefox (I don't use the others, but I assume it mostly applies) will remember what you enter in any field of any form. Passwords are special probably because the field is marked as type="password" so Firefox will (by default) ask if you want to remember the credentials. If you select "Never ask again" it will never ask again, which might be what you're seeing. It stores this information per page and there's a setting somewhere which allows you to reset this, of course.

Tomislav Nakic-Alfirevic
A: 

Here is another question that has some good answers:

http://stackoverflow.com/questions/2398763/how-does-browser-know-when-to-prompt-user-to-save-password

The accepted answer explains the process a little.

animuson