title: Why are cookies in document.cookie not showing in browser cookies
body: <p>I am trying to set several cookies on the client side of my app.  I have tried </p>
  
  <pre><code>document.cookie = "cookieName=12345";
  </code></pre>
  
  <p>I have also tried using the cookies.js library from MDN setting it this way</p>
  
  <pre><code>docCookies.setItem("cookieName", "12345");
  </code></pre>
  
  <p>In both cases I can see that document.cookie gets updated correctly but in my browser no cookies are created.</p>
  
  <p>Am I doing something wrong?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have noticed 2 changes I can make to get the cookies created in the browser.  First if I only set the cookie value and not domain, path or expires then the cookie works.  This part I think I'm not building the string correctly when trying to set the other fields.  I've seen articles saying to delimit fields with semicolon and some say to use a comma.  When I use a comma, the entire string is getting set as the cookie instead of just the value.  When I use a semicolon, the document.cookie value doesn't get updated.  So I've tried these 2 ways...</p>
  
  <pre><code>document.cookie = cookieId + '=' + res[cookieId] + '; domain=.mydomain.com; ' + 'expires=' + date + '; httpOnly=true; ' + 'path="/"';
  </code></pre>
  
  <p>and </p>
  
  <pre><code>document.cookie = cookieId + '=' + res[cookieId] + ', domain=.mydomain.com, ' + 'expires=' + date + ', httpOnly=true, ' + 'path="/"';
  </code></pre>
  
  <p>The 2nd part of this issue that I've noticed is that for the cookies to show in the browser I have to refresh the page.  So I don't see the cookies as soon as they are set but I do if I refresh the browser.</p>