title: Call Modal in Codeigniter 'CSRF & AJAX' REPOERROR 403
body: <p>I'm trying to get Modal by clicking on a button to call my modal with form to add users : </p>
  
  <p>html code:</p>
  
  <pre><code>&lt;button data-toggle="modal" data-target="#mymodal" data-id="&lt;?php echo 'manager_user/user_add';?&gt;" id="menu" class="btn btn-sm btn-primary"&gt;
  Add User&lt;/button&gt;
  </code></pre>
  
  <p>and in my Modal form the input with <em>csrf name &amp; hash</em> is inserted !</p>
  
  <pre><code>&lt;input type="hidden" name="csrf_token" value="&lt;?=$this-&gt;security-&gt;get_csrf_hash();?&gt;"&gt;
  </code></pre>
  
  <p>ajax #menu is called by the button above.</p>
  
  <pre><code>    $(document).ready(function() {
          $(document).on('click', '#menu', function(e) {
              e.preventDefault();
              var url = $(this).data('id'); // it will get action url
              $('#dynamic-content').html(''); // leave it blank before ajax call
              $('#modal-loader').show(); // load ajax loader
  
              $.ajax({
                  url: url,
                  type: 'POST',
                  dataType: 'html'
              })
              .done(function(data) {
                  console.log(data);
                  $('#dynamic-content').html('');
                  $('#dynamic-content').html(data); // load response 
                  $('#modal-loader').hide(); // hide ajax loader 
              })
              .fail(function() {
                  $('#dynamic-content').html('&lt;i class="glyphicon glyphicon-info-sign"&gt;&lt;/i&gt; Something went wrong, Please try again...');
                  $('#modal-loader').hide();
              });
          });
      });
  
  
  
  $config['csrf_protection'] = TRUE;
  $config['csrf_token_name'] = 'csrf_token';
  $config['csrf_cookie_name'] = 'csrf_cookie_token';
  $config['csrf_expire'   ] = 7200;
  $config['csrf_regenerate'] = FALSE;
  </code></pre>
  
  <p>When i turn <strong>csrf_protection</strong> to <strong>FALSE</strong> it works</p>
  
  <p>I did also add a meta to my header !!
  so when I click to show my modal to add user I get <strong>403 Forbidden ERROR</strong>.</p>
  
  <p>and Error AJAX Message  : <strong>Something went wrong, Please try again...</strong></p>
  
  <p>how to I resolve the csrf issue?</p>