title: Electron cookie
body: <p>For electron cookie I used <a href="https://www.npmjs.com/package/electron-cookies" rel="nofollow">https://www.npmjs.com/package/electron-cookies</a></p>
  
  <p>Then added this into my html</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  require('electron-cookies')
  function createCookie(name,value,days) {
      if (days) {
      var date = new Date();
      date.setTime(date.getTime()+(days*24*60*60*1000));
      var expires = "; expires="+date.toGMTString();
      }
      else var expires = "";
                          document.cookie = name+"="+value+expires+"; path=/";
                      }
  
                      function getCookie12(name) {
                        var regexp = new RegExp("(?:^" + name + "|;\s*"+ name + ")=(.*?)(?:;|$)", "g");
                        var result = regexp.exec(document.cookie);
                        alert(document.cookie);
                        return (result === null) ? null : result[1];
                      }
      &lt;/script&gt;
  </code></pre>
  
  <p>and called the methods :</p>
  
  <pre><code>&lt;button onclick="createCookie('ppkcookie','testcookie',7)"&gt;Set Cookie&lt;/button&gt;
  &lt;button onclick="getCookie12('ppkcookie')"&gt;Get Cookie&lt;/button&gt;
  </code></pre>
  
  <p>but the <code>alert(document.cookie)</code>
  shows me only </p>
  
  <p><code>ppkcookie</code> not <code>ppkcookie=testcookie</code></p>
  
  <p>Any ideas why?</p>
  
  <p>Many thanks</p>