I don't know if it's obvious but you can send the information to the server each time the header is clicked :
$('#accordion > h3').click(function(e){
var header = $(this).html();
//then send an ajax request to the server
$.post(yoururl,{category:header});
});