title: Setting gwt cookie when redirecting to other domain
body: <p>I have a web application developed using gwt.2.5.1, java. In my application i have a link "Volex page" which will send to the request to the other server(Volex).</p>
  
  <p>supppose if i open my application with "<a href="http://localhost:8085/myApp" rel="nofollow">http://localhost:8085/myApp</a>" and can see the "vloex page", once user clicks 
  on the 'Volex page' it will be redirected to 'Volex server' like below.</p>
  
  <p>Window.Location("<a href="http://167.23.543.34:8087/VolexSer/volex" rel="nofollow">http://167.23.543.34:8087/VolexSer/volex</a>")</p>
  
  <p>The above url hits the volex server which needs some inforamtion like session id, for this i have to set the session id in the cookie like below:</p>
  
  <pre><code>    Date cookieDate = new Date();
      cookieDate.setDate(cookieDate.getDate() + 1);
      String baseUrl = "http://167.23.543.34:8087/VolexSer/volex";
      Integer nDomainInitialPosition = baseUrl.indexOf("/");
      Integer nDomainEndPosition = baseUrl.lastIndexOf(":");
      String baseDomain = baseUrl;
  
      if (nDomainInitialPosition == nDomainEndPosition) {
          nDomainEndPosition = baseUrl.indexOf("/");
      }
      baseDomain = baseUrl.substring(nDomainInitialPosition + 2, nDomainEndPosition);
      Window.alert("baseDomain: " + baseDomain);
      String eWebPageUrl = com.google.gwt.user.client.Window.Location.getHref();
  
      if (eWebPageUrl.contains("https://")) {
          Cookies.setCookie("sessionId", LoginInfo.getSessionId(), cookieDate, baseDomain, "/", true);
      } else {
          Cookies.setCookie("sessionId", LoginInfo.getSessionId(), cookieDate, baseDomain, "/", false);
      }  
  </code></pre>
  
  <p>Here opening with two domains one is "localhost" other is "167.23.543.34", If i set the cookie like above, it is not showing in the request header. Can any body tell mw what is the wrong in the above code?</p>