title: Using decodeURI with cookies javascript
body: <p>My problem at hand is that I need a variable that will keep track of all of my cookies so that I can split up the string in that variable into an array and then parse the string from there. I am wondering why the simple following code is not doing that for me? </p>
  
  <pre><code>var count = 0;          //keeps track of how many times this page has been visited
  var lastVisit = new Date();     //records the last visit date in UTC format (or extra-challenge: in a user-friendly format like "Tuesday 10/12/2013 at 9:34:50")
  var exDate  = new Date(lastVisit.getTime() + 30000);
  var savedData = decodeURI(document.cookie);  //contains cookie contents
  
  document.cookie = encodeURI("count=" + count.toString() + "; expires=" + exDate.toUTCString());
  </code></pre>
  
  <p>What I need to happen is whenever I set a cookie for it to be added to the savedData variable, I cannot figure out why this is not happening. Thank you</p>