title: Why does jQuery cookie not actually set a cookie?
body: <p>I am developing an application using jQuery that uses cookies. Right now, it is located at <code>application.html</code> on my PC desktop.</p>
  
  <p>However, I cannot store and retrieve a cookie. I had included <code>jquery-1.7.1.min.js</code>, <code>json2.js</code>, and <code>jquery.cookie.js</code> in my HTML file in that order.</p>
  
  <p>Here is how I am storing a cookie to last for 7 days:</p>
  
  <pre><code>$.cookie("people", JSON.stringify(people_obj_array), {expires: 7});
  </code></pre>
  
  <p>The global array <code>people_obj_array</code> looks like</p>
  
  <pre><code>[
          {
              "name": "Adam",
              "age": 1,
          },
          {
              "name": "Bob",
              "age": 2,
          },
          {
              "name": "Cathy",
              "age": 3,
          },
      ]
  </code></pre>
  
  <p>When I test JSON encryption with <code>alert(JSON.stringify(people_obj_array))</code>, it looks fine:</p>
  
  <p><img src="https://i.stack.imgur.com/nKWwV.png" alt="JSON test"></p>
  
  <p>However, when I retrieve this cookie via:</p>
  
  <pre><code>alert($.cookie("people"));
  </code></pre>
  
  <p>before even refreshing the page, an alert pops up that reads "null." Shouldn't the text be the alert JSON string? Am I using the JQuery cookies library correctly?</p>
  
  <hr>
  
  <p>Just to clarify, here is how I am testing:</p>
  
  <pre><code>$.cookie("people", JSON.stringify(people_obj_array), {expires: 7}); // store
  alert($.cookie("people")); // attempt to retrieve
  </code></pre>
  
  <p>I have Firebug, and I am willing to do some Console tests.</p>