title: How to read json object from cookie
body: <p>I use jquery.cookie to store my client-side application cookies and some of these cookies contains JSON.</p>
  
  <p>This is my script so far</p>
  
  <pre><code>trigger.on('click touchend', function () {
      var StoredSettings = $.cookie('qlToggled'),
          isToggled = 0,
          offset = -300,
          endpoint = 15,
          triggerX = $('#leftcolumn').offset().left + $('#leftcolumn').width();
  
      if (typeof StoredSettings !== 'undefined') {
          isToggled = StoredSettings.toggled;
          offset = StoredSettings.cOffset;
          endpoint = StoredSettings.cEndpoint;
          triggerX = StoredSettings.cTriggerX;
      }
  
      if (isToggled == '1') {
          offset = 0;
          endpoint = 315;
          triggerX = $('#leftcolumn').width();
          var cookieValues = { toggled: '0', cOffset: offset, cEndpoint: endpoint, cTriggerX: triggerX };
          $.cookie('qlToggled', JSON.stringify(cookieValues), { expires: 365, path: '/', json: true });
      }
      else {
          var cookieValues = { toggled: '1', cOffset: offset, cEndpoint: endpoint, cTriggerX: triggerX };
          $.cookie('qlToggled', JSON.stringify(cookieValues), { expires: 365, path: '/', json: true });
      }
  
      $('#leftcolumn').animate({ 'left': offset }, speeding);
      $('#content').animate({ 'margin-left': endpoint }, speeding);
      trigger.animate({ 'left': triggerX }, speeding);
  });
  </code></pre>
  
  <p>I use FireBug to see which cookies are saved and the cookie created in the above script is successfully created and I have tried to iterate the values using <code>$.each(object, function(i ,e))</code> to see if anything came out and there did.</p>
  
  <p>I'd prefer to NOT having to iterate through the values and just use chainable code as seen within the first if-statement.</p>
  
  <p>What am I missing/doing wrong?</p>