Tuesday, July 10, 2012

Disable browser's Save Password functionality - Liferay Theme

Whenever we use <input type="password"> in our page, the website tells the browser that it is a password field. And when we  provide input for that field and submit the page browser automatically provides one option to remember that password.

Most recent versions of web browsers prompt us to save usernames and passwords for various sites on the Internet. This feature can be useful, but can also put our  money and personal information at risk if we are not careful.

So I finally got a solution to disable it programmatically. This eliminates the need to disable it explicitly on the browser. A small change in the form tag does the trick

<form id="formName" action="login.cgi" method="post" autocomplete="off">

If we add autocomplete="off" in form tag the browser will never offer to remember passwords. This is the easiest and simplest way to disable  Password storage prompts and prevent form data from being cached in session history.

No comments:

Post a Comment