title: JavaScript Cookies are not being set
body: <p>I followed went through some related threads and also followed the tutorial on <a href="http://www.quirksmode.org/js/cookies.html" rel="noreferrer">http://www.quirksmode.org/js/cookies.html</a> but I can't get my cookie to set. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function setcookie(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=/";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Then in my  tag I have:</p>
  
  <pre><code>&lt;body&gt;
  &lt;script type="text/javascript"&gt;
      setcookie("testcookie", "test", 1);
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Any ideas where I'm going wrong? I have cookies enabled, using FF and I can see cookies being created in real time by sites like Youtube but this one won't set at all.</p>