title: Javascript/jQuery: Basic auth over multiple requests
body: <p>I am sending an Ajax-GET-requests using basic auth:</p>
  
  <pre><code>$.ajax({
    type: "GET",
    url: url,
    beforeSend: function(xhr){
       xhr.setRequestHeader( "Authorization", "Basic "+btoa("username:password"));
       xhr.setRequestHeader( "Accept", "application/json" );
      },
    success: function(data){
      console.warn(data);
    }
  });
  </code></pre>
  
  <p>This is working perfectly fine - but do I have to send the username/password on every request?</p>
  
  <p>This would mean, that I have to ask the user for his username/password on every request / or store it in Javascript, which is not very safe. </p>
  
  <p>Is there any way to send the username/password only once, even for multiple requests?</p>
  
  <p>Thank you very much!</p>