Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My experience is that using .htAccess to password protect a directory, it brings up a modal dialog box. And for some browsers (FF and Chrome) don't show the checkbox for "remember" this password.

Is there a way to that a password protect a directory and have the user fill in the username and password within the web page?

Or, is there a way to force the browser to remember that password?

share|improve this question
up vote 4 down vote accepted

Short answer: No

Long answer: The dialog in your browser is opened when the server sends the 401 Not Authorized response code followed by the WWW-Authenticate: Basic realm="insert realm" header. The specs do not include headers to control the dialog behavior.

To display a webpage you need to get a little bit fancier and consult the programming language of your choice.

There is no simple way to achieve what you want with password based authentication

share|improve this answer

Use a web-application-framework.. like Drupal. Then put this at the top:

// initialize Drupal
// TODO: adjust path according to placement of script (might need to change to Drupal directory first)
require './includes/';
// check user access rights
// TODO: Adjust to the permission you want to restrict to, e.g. 'access content' or whatever
if (!user_access('administer nodes')) {
  // Insufficient rights, say so
// ... call legacy script

FYI: IT changes with each version. Then only allow profiles, or users based on their profile name or userid in that system, or as above, the individual permission.

Then use the authentication modules, interactions, protections etc, already built into that. Takes care of all the heavy lifting and updates to the API.

There are loads: Symfony, Magento, Zend... GIYF..

share|improve this answer

Take a look at the "Auto Auth" Firefox plugin:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.