title: Httprequest cookie is null after REST call to different domain
body: <p>So Im making a rest call to a Ws I have deployed in a different domain name.</p>
  
  <p>How can I pass over cookie in request if its in a different domain?</p>
  
  <p>Origin: profileUI-sandbox.testServer.com</p>
  
  <p>So this is my ajax call</p>
  
  <pre><code>    Util.ajax({               
              url: "https://profileWS-sandbox.testServer.com/rs/myProfile",
              dataType : CONSTANTS.DATA_TYP_JSON,
              type : 'GET',
              success : success,
              error : error,
              cache: false
          });
      },
  </code></pre>
  
  <p>In my server side code I have a filter set in my web.xml going to a servlet to read the cookie etc and do some other stuff before redirecting to the Webservice.</p>
  
  <pre><code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException 
  {
  
      HttpServletRequest httpRequest = (HttpServletRequest) request;
      HttpServletResponse httpResponse = (HttpServletResponse) response;
  
  
      LOGGER.debug("Adding Access Control Response Headers"); 
      httpResponse.setHeader("Access-Control-Allow-Origin", "*"); 
      httpResponse.setHeader("Content-type", "application/json"); 
      httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
      httpResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, HEAD, OPTIONS");
      httpResponse.setHeader("Access-Control-Allow-Headers", "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers");
  
  
      try {
          Cookie cookies[] = httpRequest.getCookies();
  
          LOGGER.debug("Iterating over cookie");
          for(Cookie cookie:cookies)
          {
              LOGGER.debug("cookie.getName():" +  cookie.getName());   
          }
  </code></pre>
  
  <p>Problem is, my cookie is coming back as null.
  Im fairly sure this has something to do with the different domains as when I test locally it works fine.</p>
  
  <p>Thoughts?</p>