title: Using a cookie as a counter?
body: <p>I am trying to create and store a cookie with the jQuery Cookie Plugin. I want to cookie to just be an ordinary counter. I need it to be a cookie because I want to keep the counter going if the page is refreshed. When some condition is true I want, 1 to be added to the cookie value. It seems simple but I am having trouble with using the plugin. </p>
  
  <p>I have created the cookie like this:</p>
  
  <pre><code>$(document).ready(function(){
      $.cookie("cookieValue", "0", { expires: 7 , path: '/' }); 
  });
  </code></pre>
  
  <p>A small example of what I'm trying to achieve:</p>
  
  <pre><code>if (/*some condition*/) {
      cokieValue++;
  }
  </code></pre>
  
  <p>That did not work when the condition was true, the cookie value remained at 0. I also tried:</p>
  
  <pre><code>$(document).ready(function(){
      $.cookie("cookieValue", "0", { expires: 7 , path: '/' });  
      var cookieValue = parseInt($.cookie("cookieValue"));
  
      if (/*some condition*/) {
          cookieValue++;
      } 
  });
  </code></pre>
  
  <p>This also did not work - cookieValue remained at 0. Any suggestions on how I can accomplish this?</p>