title: CodeIgniter CSRF and localhost
body: <p>I am currently working locally (myhostname.local) to begin a development project in CodeIgniter and am trying to do a simple login form submission and the CSRF protection is not working.  I get the error:</p>
  
  <blockquote>
    <p>An Error Was Encountered<br>
       The action you have requested is not allowed.</p>
  </blockquote>
  
  <p>A couple of things to note:</p>
  
  <ol>
  <li>I am using CI Reactor 2.0.2</li>
  <li>I am running everything from a local host (myhostname.local)</li>
  </ol>
  
  <p>My form:</p>
  
  <pre><code>&lt;?=form_open('home/login');?&gt;
  ... username/password fields in here ...
  &lt;?=form_close();&gt;
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>public function login()
  {
  
      $this-&gt;form_validation-&gt;set_rules('email','Email','trim|required');
      $this-&gt;form_validation-&gt;set_rules('password','Password','required');
  
      if($this-&gt;form_validation-&gt;run() === FALSE)
      {
          ... form did not pass validation ...
      }
      else
      {
          ... form passed ...
      }
  
  }
  </code></pre>
  
  <p>When I submit the form to <a href="http://myhostname.local/home/login" rel="nofollow">http://myhostname.local/home/login</a> I get the above error.</p>
  
  <p>Any help on why this is happening is much appreciated.</p>
  
  <p>Thanks!
  Sean</p>