title: The cookie is deleted when the browser is closed
body: <p>I have this cookie to store users previous selection from a menu. But I want keep this cookie stored in the browser even if the user closes the browser. This code perfectly works on IE but when I close Chrome and Firefox, the cookie getting deleted. Can anyone provide me solution for this.</p>
  
  <pre><code>function setCookie(NameOfCookie, value, expiredays) {
      var ExpireDate = new Date();
      document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
  }
  
  function delCookie (NameOfCookie) {
    if (getCookie(NameOfCookie)) {
      document.cookie = NameOfCookie + "=" + "; expires=Thu, 17-Jul-24 00:00:01 GMT";
    }
  }
  </code></pre>