defines a password field (characters are masked).. I want to store user name and password for the next time if user check remember me for next time in 'Login control' in web application. So i want to check that is user valid or not so that user can authorized for the rights. JS provides the functionality of Hash-map using the .map( ) function, in which objects can be stored as a [key , value] pair, and can be accessed as hashmap[key] = value; Here, I have stored the Email ID as the key, and password as the value. byte[] salt = new byte[8]; random.nextBytes(salt); return Base64.getEncoder().encodeToString(salt); } private void saveUser(UserInfo user) { userDatabase.put(user.userName, user); } } // Each user has a unique salt // This salt must be recomputed during password change! var username = getCookie("username"); if (username != "") { alert("Welcome again " + username); } else { username = prompt("Please enter your name:", ""); if (username != "" && username != null) { setCookie("username", username, 365); } }} Synchronous example: if (window.PasswordCredential) { … //Store the password field objects into variables ... var password = document . Master page is used here. getElementById ( 'password2' ) ; var confirm = document . result in a page transition: By preventing a page transition, So here is my question somehow related to that. Simply, the username and password from the form submitted will be the current user details and we will store them in SessionStorage, using the setItem method, that takes in a (key, value) pair. document.getElementById("message").style.display = "block"; } Two of the great functionalities Modern JavaScript can work with, are LocalStorage and SessionStorage. JavaScript is a lightweight scripting language, yet it provides such a great number of functionality, from making dynamic webpages to creating servers, mobile applications, etc. Learn more about autofill in In our example, we have a login form with two input fields i.e. The first order of business is to create a new Node.js application with all the required dependencies. Calculating the hash of any user input is extremely easy. If you prefer callbacks: bcrypt.hash('PASSWORD', saltRounds, (err, hash) => { }) … PasswordCredential Thank you for the feedback. function btoa(‘string’) encodes the string passed while atob(‘encoded_string’) does the decoding of the encoded string. The password must be stored in the LocalStorage in encrypted form, else they can be easily extracted out. 2. Web storage is more secure, and large amounts of data can be stored locally, without affecting website performance. Their are many complex ways to iterate through the maps, ranging from usage of reduce( ) function to using Object.assign( ). The user ID and password are stored in LS as an array of objects. Remember to use atob(‘password’) to decode it for comparing the one stored in the LocalStorage. with the form element as an argument So, for storing user information like user ID and password, we will use LocalStorage and the currently logged-in user’s info will be visible inside the SessionStorage itself! Note: Any forms involving sensitive information like passwords should be served over HTTPS. If the API is not available, Save credentials from sign-in forms Time to parse through the array of objects we stored above and displaying a list of users appended to the