title: Where to store auth token (frontend) and how to put it in http headers of multiple endpoints?
body: <blockquote>
    <p>I wanted to write auth backend for both mobile and webapp, so I decided to go with the DRF (Django Rest Framework) token authentication.<br></p>
    
    <p>I pretty much figured out backend via DRF documentation but regarding frontend implementation it just says "<em>include token in the header of every http request to the API</em>."<br></p>
  </blockquote>
  
  <hr>
  
  <p>So my question is</p>
  
  <ol>
  <li><strong>When I retrieve token in AJAX call where should I store it so that upon browser refresh it doesn't disappear?</strong><br>
  (Apparently I'm not using cookies, because phones have restriction on cookie uses )</li>
  <li><strong>How to insert the auth token in the http headers of multiple API endpoints?</strong><br></li>
  </ol>
  
  <p>With the help of Stackoverflow I figured out how to insert auth token in a single http header.</p>
  
  <pre><code>$.ajax({
    url: "https://www.something.com/random",
    type: 'get',
    headers: {
      token: "t&amp;jdd9HJKHdss7hkjjkhdshgs",
    }
  });
  </code></pre>
  
  <p>I was wondering If I have to write this piece of code for every endpoints or is there a way cover all the endpoints without being redundant?</p>