title: GetCookie returns NULL
body: <p>I try to set and get Cookies in Javascript and Jquery, but it returns <strong>null</strong> for both of these methods. my code looks correct but I don't know why it doesn't work for me.</p>
  
  <blockquote>
    <p><em><strong>cook.js</em></strong></p>
  </blockquote>
  
  <pre><code>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=/";
  }
  
  function getCookie(name) {
      var nameEQ = name + "=";
      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,c.length);
              if (c.indexOf(nameEQ) == 0) 
                  return c.substring(nameEQ.length,c.length);
      }
      return null;
  }
  
  function deleteCookie(name) {
      setCookie(name,"",-1);
  }
  </code></pre>
  
  <p>and my html pages :</p>
  
  <blockquote>
    <p><em><strong>fin.html :</em></strong></p>
  </blockquote>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;My Page&lt;/title&gt; 
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; 
          &lt;script type="text/javascript" src="jquery-1.7.1.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="jquery.cookie.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="cook.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;a id="setcookie" href="fin2.html"&gt;SET COOKIE&lt;/a&gt;
          &lt;script&gt;
              $("#setcookie").click(function() {
                  // Using javascript function
                  setCookie("mycookie", "itsvalue", 1) ;
  
                  // Using jQuery plugin
                  $.cookie('myCookie2': "myValue");
              });
          &lt;/script&gt;
       &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <blockquote>
    <p><em><strong>fin2.html</em></strong></p>
  </blockquote>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;My Page&lt;/title&gt; 
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; 
          &lt;script type="text/javascript" src="jquery-1.7.1.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="jquery.cookie.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="cook.js"&gt;&lt;/script&gt;      
      &lt;/head&gt;
      &lt;body&gt;
          &lt;a id="get" href="#"&gt;YOO&lt;/a&gt;
          &lt;script&gt;
              $("#get").click(function() {
                  alert(getCookie("mycookie")) ;
                  alert($.cookie('myCookie')) ;
              }) ;
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but it returns null using jquery plugin and javscript's functions. Do you have any idea about this problem ? Thank you a lot :)</p>