title: Sharing Cookie between two applications on the same Tomcat server
body: <p>I'm using a Tomcat 7 server (Xampp for development) and I have the following apps deployed:</p>
  
  <p>Tomcat/Webapps/App1 (FrontOffice)<br>
  Tomcat/Webapps/App2 (BackOffice)</p>
  
  <p>the App2 is generating a Cookie (session.setAttribute("X","myValue")) that I need to retrieve on my App1 (via a jsp page by using $(X)).</p>
  
  <p>This solution is working well if I'm deploying a unique application containing both app1 and app2. But for deployment reason, I need to separate Front and BackOffice.</p>
  
  <p>So I tried to configure my Tomcat server to enable session Cookie for any app of my Context.</p>
  
  <p>Here are the updates I performed:</p>
  
  <p>on my Tomcat conf/context.xml:</p>
  
  <pre><code>&lt;Context sessionCookiePath="/" crossContext="true"&gt;...
  </code></pre>
  
  <p>on my App2 Web.xml:</p>
  
  <pre><code>&lt;session-config&gt;
  &lt;session-timeout&gt;30&lt;/session-timeout&gt;
  &lt;cookie-config&gt;
  &lt;path&gt;/&lt;/path&gt;
  &lt;/cookie-config&gt;
  &lt;/session-config&gt;
  </code></pre>
  
  <p>I restarted Tomcat but from my App1, I'm not able to retrieve session attributes created by my App2.</p>
  
  <p>May be I'm missing something ?</p>