开发者

Block remember password [duplicate]

开发者 https://www.devze.com 2023-02-08 16:59 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Disable b开发者_如何学编程rowser 'Save Password' functionality
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Disable b开发者_如何学编程rowser 'Save Password' functionality

How can you block the remember password prompt in an HTML form? An example is PayPal, which does not allow stored passwords.

I know autocomplete should be off and there is another trick to block the autocomplete when the browser doesn't support the attribute (make a hidden field named password). These two methods do not work in blocking the browser from prompting to store the password however.


Send auth request using Ajax, then do JavaScript redirect on success.

// in JQuery it would be like this
$.post({
    url: '/login.php', 
    data: 'username=test&pass=test', 
    success: function(data) {
        window.href='success.php'
    }
});

OR

(I haven't tried this yet)

You can clear (or delete from DOM) username & password field before submit, and merge (may be hash as well) them into one hidden field and then do regular post.

On login page you need to reverse engineer that info again.


using javascript...

document.getElementById('usernameOrWhatever').setAttribute( 'autocomplete', 'off' )
0

精彩评论

暂无评论...
验证码 换一张
取 消