title: Ionic 3.5.2 or Angular 4 set cookie for an external website before navigate to
body: <p>I am testing with the Ionic 3.5.2 but I think we get the same with Angular 4.</p>
  
  <p>I am building a front end app using Ionic or Angular (so, my domain now is the localhost).</p>
  
  <p>from my "localhost", I want to navigate to an external website <a href="https://xyz.abc.com/a/b/c" rel="nofollow noreferrer">https://xyz.abc.com/a/b/c</a></p>
  
  <p>The point here is that the external website requires a cookie for its processing like the SSO.</p>
  
  <p>I used the <a href="https://www.npmjs.com/package/ng2-cookies" rel="nofollow noreferrer">ng2-cookies</a> to set the cookie as required
  the code looks very simple, something like this</p>
  
  <pre class="lang-js prettyprint-override"><code>this.cookieService.set('cookieName', 'cookieValue', 10, '/', '.xyz.com');
  </code></pre>
  
  <p>before I navigate to the web site by this code snippet</p>
  
  <pre class="lang-js prettyprint-override"><code>window.location.href = "https://xyz.abc.com/a/b/c/";
  </code></pre>
  
  <p>Everything looks very simple, but don't know why it doesn't work. It looks like the cookie is rejected.</p>
  
  <p>I think it relates to security or something else. Please help to shed a light if I miss something.
  I use this code to check if the cookie is set or not, apparently it is not stored</p>
  
  <pre class="lang-js prettyprint-override"><code>var t = this.cookieService.check('cookieName');
  </code></pre>
  
  <p>Or I might get a wrong domain name for the cookie?</p>