jquery accordion cookie / persistence
===

i want to save the state (open/closed) of an accordion menu with jquery.cookie. 
Could someone help me to set the cookie? I am a total noob at jquery..


    $('#menu').children('[data-header]').hide().each(function() {
        $(this).before('<h3 class="menu-header">' + $(this).data('header') + '</h3>');
    }).prev().on("click", function() {
        $(this).toggleClass('on').next().slideToggle();
      });

I will be very thankful for the help!