title: Codeigniter CSRF protection with datatables ajax url
body: <p>I am using codeigniter and we have enabled CSRF protection,</p>
  
  <pre><code>$config['csrf_protection'] = TRUE;
  </code></pre>
  
  <p>We have used :</p>
  
  <pre><code>`&lt;input type="hidden" name="&lt;?php echo $this-&gt;security-&gt;get_csrf_token_name(); ?&gt;" value="&lt;?php echo $this-&gt;security-&gt;get_csrf_hash(); ?&gt;"&gt;` 
  </code></pre>
  
  <p>in the form submission and its working fine,</p>
  
  <p>But my application also use DataTables to get server data with AJAX,</p>
  
  <pre><code>var handleDataTable = function () {
      var table = $('#my_table').DataTable({
        "ajax": {
            "url" : baseURL + "user/core/data/"+report_id,
            "dataType" : "json",
            "type" : "POST", // ajax source
          },
      });
  }
  </code></pre>
  
  <p>Obviously this will show "<code>The action you have requested is not allowed.</code>" message,</p>
  
  <p>How can i pass csrf in Ajax retrieving data?</p>