title: Unable to save JStree state with cookies
body: <p>I am creating the tree with JStree and trying to save the tree state with a cookie plugin, but I'm unable to do so. </p>
  
  <p>Whenever I refresh the page, the tree is collapsed and starts from the beginning. Do I need to write any special code for preserving the state and refetching from cookie? </p>
  
  <p>This is my code:</p>
  
  <pre><code>$(function() {
    drawJsTree();
  });
  function drawJsTree(){
  var totalNodes = 0;
  $("#jstree").jstree({
          "themes" : {
              "theme" : "classic",
              "dots" : false,
              "icons" : true
          },
          "cookies" : { 
                      "cookie_options" : {
                                      "path": "C:"
  
                                      } 
                  }, 
          "types" : {
              "types" : {
                  "root" : {
                      "icon" : { 
                          "image" : "http://static.jstree.com/v.1.0rc/_docs/_drive.png" 
                      }
                  },
                  "leaves" : {
                      "icon" : { 
                          "image" : "http://static.jstree.com/v.1.0rc/_docs/_drive.png" 
                      }
                  }
              }
          },
          "json_data": {
              "data": (function(obj){
                  var s = this.get_settings().json_data
                  var newNodes = [];  
                  for(var i = 0; i &lt; 10; i++)
                  {
                      totalNodes += 1;
                      newNodes.push({"data" : "Node " +(totalNodes-1), "attr": {"id": "node" + (i + totalNodes) , "rel" : "root"}, "state": "closed"});
                  }
                  if (obj!= -1)
                  {
                                      // get parent / grandparent node
                      var lists = $(obj).parents('ul');
                      var p = $(lists[0]).prev('a');
                      var gp = $(lists[1]).prev('a');
                      var t= {
                          "parent": $.trim(p.text()),
                          "grandparent": $.trim(gp.text()),
                          "id": obj.attr ? obj.attr("id"): 1,
  
                      };
                  }
                  var d = this._parse_json(newNodes, obj);
                  if(!d) {
                  if(obj === -1 || !obj) {
                      if(s.correct_state) { this.get_container().children("ul").empty(); }
                  }
                  else {
                      obj.children("a.jstree-loading").removeClass("jstree-loading");
                      obj.removeData("jstree_is_loading");
                      if(s.correct_state) { this.correct_state(obj); }
                      }
                  }
                  else {
                      if((obj === -1) || !obj) { 
                          this.get_container().children("ul").empty().append(d.children()); 
                      }
                      else { 
                          obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); 
                      }
                      //this.clean_node(obj);
                  }       
                  if((obj) &amp;&amp; (obj!= -1))
                      obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");               
  
              })
          },
           "plugins": ["themes", "json_data", "ui", "types", "cookies"]
      })
      .bind("select_node.jstree", function (NODE, REF_NODE) {
              /*var newNodes = [];  
                  for(var i = 0; i &lt; 10; i++)
                  {
                      newNodes.push({"data" : "Node " +i, "attr": {"id": "node" +i, "rel" : "root"}, "state": "closed"});
                  }*/
                  $.jstree._focused()._get_settings().json_data.data = [];
                  $.jstree._focused().refresh(-1); 
  
                  $.jstree._reference("#jstree").destroy();
                  self.drawJsTree();
       });
  }
  </code></pre>