title: Can a cookie be used to pass data from a web app on one server to a web app on a different server in the same domain?
body: <p>I have been given the task of sending data from one application to another.  More than likely that the resources are on different web servers. I do not know yet,  so I am assuming that they are on different servers. However, they are in the same domain like the following: </p>
  
  <pre><code>http://a.bbb.com/SevletX
  http://a.bbb.com/ServletY
  </code></pre>
  
  <p>I need to be able to send some sensitive data from the first resource to the second resource. Assuming that they are on 2 different servers, RequestDispatcher will not work.  I do not have the option of using query string as the data is sensitive information (user credential).</p>
  
  <ol>
  <li><p>If I set a cookie in the first resource and redirect, will the cookie be available to the second resource? I do not have the environment where I can test this.</p></li>
  <li><p>If the above is true, can I serialize an object, convert it into a string and then set the string value in the cookie and retrieve it in the second resource, deserialize and get the object back?</p></li>
  <li><p>Would the cookie be safe enough (say over https)to send sensitive data such as user credentials?</p></li>
  </ol>