title: Tomcat - Session ID changes for every request through vritual host
body: <p>For example, all normal requests go through <code>virtual host 443</code> and to tomcat with the same JSESSIONID. But somewhere in the process the APP needs to send traffic through  <code>virtual host 1234</code> for some other app functionally to work and that's when JSESIONID changes and then eventually 443 and 1234 both keeps flipping JSESSIONID....</p>
  <p>The issue happens only in Docker container when the setup is like this <code> Httpd pod forwards requests to -&gt; Tomcat pod</code></p>
  <p>In production, we have a single server for <code>apache and tomcat</code> and it retains session.</p>
  <p>Is there a way I can preserve JESSIONID between both virtual hosts connection?</p>
  <pre><code>443 traffic holds a different JSESSION ID
  1234 traffic holds a different JESSION ID
  </code></pre>
  <p>There is no loadbalancer for tomcat since its just a single server. And I'm using mod_jk. I've set sticky_session=true for AJP worker.</p>
  <pre><code>&lt;VirtualHost *:443&gt;
         ServerName .. 
         SSL certs..
         JkMount /app/*
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:1234&gt;
         ServerName .. 
         SSL certs..
         JkMount /app-service/*
  &lt;/VirtualHost&gt;
  </code></pre>