2
I have in a web application that, in a conventional way, asks a user and password to login to the system.
This user and password are encapsulated in a form (simplified example):
<form id="formLogin">
<input type="text" id="usuarioLogin"></input>
<input type="password" id="senhaLogin"></input>
</form>
Now within the application I have another form that requests a different credential, for a specific procedure. The form is very similar, but note that the id’s are different:
<form id="formCredencialEspecial">
<input type="text" id="usuarioCredencial"></input>
<input type="password" id="senhaCredencial"></input>
</form>
Result: The browser remembers the login password, although it is another password. The user can change the password and validate the special credential, but this makes saving a password now invalid for login (first form).
There is how to tell the browser that these Forms are different credentials, and should be stored as separate passwords?
Remarks:
- These web pages comprise a SPA (developed in Aurelia), and are within the same domain and HTTP resource;
- The reason for requesting a second credential is not up for discussion on this issue.
Why not store both cookies?
– Miguel
I never had to do this, but I think it depends on the browser, each one deals with it in their own way.
– Neuber Oliveira
@Miguel - I already do this. The first login the user ends up informing only once. The second credential is always informed, which is finally the password that is actually saved by the browser. In this case, only in the first access that occurs this situation. Still, I think it is a curious case worth the question.
– Jônatas Hudler