Ajax Post中的CSRF cookie

I use CodeIgniter framework and use this function to sort my news-posts

$(".news-list").sortable({
 opacity: 0.6,
 cursor: 'move',
 update: function(event, ui) {
    var order = $(this).sortable("serialize"); //console.log(order);
   $.ajax({
     type: 'POST',
     url: "<?php echo base_url();?>news/sort_posts/", 
     data: ( order ),
     success: function(data){ console.log('Success'); },
     error: function(data){ console.log("Fail"); }
    })
},
      distance: 15 
});

Allthough I have to disable CSRF in config.php to make it work, since the CSRF-cookie is not included.

So, with the order-array I want to send:

<?php echo $this->security->get_csrf_token_name() ?> : '<?php echo $this->security->get_csrf_hash() ?>'

How is this done?

Php:

$token = '&'.$this->security->get_csrf_token_name().'='.$this->security->get_csrf_hash();

jQuery:

order += "<?php echo $token; ?>"; 

You really just need to grab the value and append it to the data params

<?php
$token = $this->security->get_csrf_token_name() . '=' . $token = $this->security->get_csrf_hash();
?>

var order = $(this).sortable("serialize");
order += "&csrf=<?php echo $token; ?>"