title: Make browser submit additional HTTP-Header if click on hyperlink
body: <p>Is there a way to make the webbrowser submit additional HTTP header if the user clicks on a link?</p>
  
  <p>Background: In our environment every http-request has a unique ID on the server side. See <a href="https://serverfault.com/questions/797609/apache-x-request-id-like-in-heroku">https://serverfault.com/questions/797609/apache-x-request-id-like-in-heroku</a></p>
  
  <p>If your web application receives a http-request, I would like to know which page was the page before. The http referrer is not enough, since <strong>the user could use several tabs in his browser.</strong></p>
  
  <p>I would like to avoid to put the ugly request-id into every GET request which gets send from the browser to the server. Up to now our URLs are nice.</p>
  
  <p>My prefered solution would be some JavaScript magic which adds the request-id of the current page into the next http request.</p>
  
  <p>Steps in detail:</p>
  
  <ol>
  <li>browser access URL <a href="http://example.com/search" rel="noreferrer">http://example.com/search</a></li>
  <li>web server receives http request with request ID 123</li>
  <li>web server sends content of the URL to the browser (a search page). The page includes the request ID 123 somewhere</li>
  <li>the user searches for "foobar". </li>
  <li>the web browser submits a http request to the server and includes the previous request id somehow.</li>
  <li>web server receives second http request (ID 456) and can access the value of the first request (ID 123) somehow.</li>
  <li>Web server can store the relation "123 --> 456" in a database for later analysis.</li>
  </ol>
  
  <p>My goal is to track the relations "123 --> 456". Above solution is just a strategy to get to the goal. Other strategies are welcome.</p>
  
  <p>We use the web framework django. But AFAIK this does matter in this context.</p>
  
  <p><strong>the user could use several tabs in his browser</strong></p>
  
  <p>I elaborate what that means for a matching solution. The sequence of requests which come from one user does not solve the issue. </p>
  
  <p>One use with several tabs:</p>
  
  <ol>
  <li>user looks at page A in tab1</li>
  <li>user looks at page B in tab2</li>
  <li>user follows a link on page A to page C</li>
  <li>user follows a link on page C to page D</li>
  <li>user follows a link on page B (tab2) to page E.</li>
  </ol>
  
  <p>I want to know see two sequences:</p>
  
  <pre><code>A -&gt; C -&gt; D
  </code></pre>
  
  <p>And</p>
  
  <pre><code>B -&gt; E
  </code></pre>