title: Javascript cannot retrieve cookies between Windows OS pages
body: <p>I am using TideSDK to develop a desktop app for windows. I am trying to use a cookie to store the information of the email address that a user enters on login. The cookie that I save for the email address (on my index.html file) somehow becomes lost when the next page (mainMenu.html) loads.</p>
  
  <p>index.html Javascript: </p>
  
  <pre><code>//this is what I call when the login information is correct
  
  
  
  function setCookie(cname,cvalue,exdays) {
  
               var d = new Date();
               d.setTime(d.getTime() + (exdays*24*60*60*1000));
               var expires = "expires=" + d.toGMTString();
               document.cookie = cname+"="+cvalue+"; "+expires;
  
               }
  
          function getCookie(cname) {
          var name = cname + "=";
          var ca = document.cookie.split(';');
          for(var i=0; i&lt;ca.length; i++) {
          var c = ca[i];
          while (c.charAt(0)==' ') c = c.substring(1);
          if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
          }
          return "";
          }
  
  
          setCookie("email",em,30); //setting the cookie
  
          window.location.href = "mainMenu.html"; // go to the next page 
  </code></pre>
  
  <p>mainMenu.html Javascript:</p>
  
  <pre><code>//this is what I call when the page gets loaded
  
  function getCookie(cname) {
      var name = cname + "=";
      var ca = document.cookie.split(';');
      for(var i=0; i&lt;ca.length; i++) {
          var c = ca[i];
          while (c.charAt(0)==' ') c = c.substring(1);
          if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
      }
      return "";
  }
     alert("email: "+getCookie("email"));
  </code></pre>
  
  <p>This is what the alert statment from my mainMenu.html looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/16XHH.png" alt="enter image description here"></p>
  
  <p>Why is my cookie not saved between files?</p>
  
  <p>Thank you in advance!!!! Please let me know if I was too vague or left anything out, I will gladly explain myself!!! :)</p>