title: REMOTE_USER and PHP_AUTH_USER sometimes empty
body: <p>I've been working on this site that is supposed to use HTTP Basic Authentication with htpasswd. The authentication itself works like a charm but sometimes (not always) $_SERVER['PHP_AUTH_USER'] is empty.</p>
  
  <p>I got the recommendation to use REMOTE_USER instead, which also only works from time to time.
  I'm using PHP as a CGI plugin for Apache, anything else is out of the question, unfortunately. The site is served SSL encrypted over HTTPS.</p>
  
  <p>Why is this happening?</p>