Download Article Show Download Article
This wikiHow teaches you how to protect an area of your website with a username and password. The steps to password-protect a website vary depending on where your site is hosted. If you write your code on the server itself or upload code from your computer, you can password-protect a directory using a file called .htaccess. If you use an online site builder like Squarespace or Wix, you can set passwords for individual areas of the page in the admin panel. And if you're using a more advanced hosting solution that allows you to create user accounts, check with your web host for instructions.
Advertisement
Advertisement Add New Question
See more answers Ask a Question 200 characters left Include your email address to get a message when this question is answered. Submit Advertisement Video
Thanks for submitting a tip for review! Advertisement
Advertisement About This ArticleArticle SummaryX 1. Log in to your site's web editor. Did this summary help you? Thanks to all authors for creating a page that has been read 722,041 times. Is this article up to date?How do I store login credentials in HTML?To store user credentials from forms:. Include autocomplete in the form.. Prevent the form from submitting.. Authenticate by sending a request.. Store the credential.. Update the UI or proceed to the personalized page.. How do I save localStorage username and password?getElementById('password'). value; localStorage. setItem("user", user_name); localStorage. setItem("pass", user_pswd); // Retrieve document.
How do I store login details in my browser?Chrome: Click on the Menu button and then select Settings. Under Settings select Passwords. Under Passwords, select the toggle to turn on Save Passwords.
How do I save a username and password in Javascript?“javascript cookies to store username and password using javascript” Code Answer. function setCookie(name,value,days) {. var expires = "";. if (days) {. var date = new Date();. date. setTime(date. ... . expires = "; expires=" + date. toUTCString();. document. cookie = name + "=" + (value || "") + expires + "; path=/";. |