Set data in password field

Hello…
I need a login control, and if a cookie is seting, load a data in a password field.
I can recover the data, but i can’t inicialize the field. Always set to empty.
How i can solve this?
Thanks!!!