Changed JavaScript for storing of username and password in localStorage.