title: Yii - Error 400 The CSRF token could not be verified
body: <p>I have a very strange problem. I have a login form in Yii which works fine. After moving the website to another server I get </p>
  
  <blockquote>
    <p>Error 400 The CSRF token could not be verified</p>
  </blockquote>
  
  <p>I don't understand why it is working on the development server but not on the new server. here is my code:</p>
  
  <pre><code>&lt;div class="form"&gt;
  
  &lt;?php $form=$this-&gt;beginWidget('CActiveForm', array(
      'id'=&gt;'login-form',
      'enableClientValidation'=&gt;true,
      'clientOptions'=&gt;array(
         'validateOnSubmit'=&gt;true,
      ),
  )); ?&gt;
  
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'username'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'username'); ?&gt;
      &lt;?php echo $form-&gt;error($model,'username'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'password'); ?&gt;
      &lt;?php echo $form-&gt;passwordField($model,'password'); ?&gt;
      &lt;?php echo $form-&gt;error($model,'password'); ?&gt;
  &lt;/div&gt;
  
  &lt;div class="row buttons"&gt;
      &lt;?php echo CHtml::submitButton('Submit'); ?&gt;
  &lt;/div&gt;
  
  &lt;?php $this-&gt;endWidget(); ?&gt;
  </code></pre>
  
  <p>and here is the csrf configuration in my config file:</p>
  
  <pre><code>'enableCsrfValidation' =&gt; !isset($_POST['dontvalidate']) ? true : false,
  </code></pre>
  
  <p>if you need to see the example. <a href="http://marionette-cola.linkmesrl.com/admin/" rel="nofollow">Here</a> is the one which is working, and <a href="http://www.marionettecolla.org/admin" rel="nofollow">here</a> is the one with the problem</p>