title: WARNING: Can't verify CSRF token authenticity using devise
body: <p>While logging with devise i am getting WARNING: Can't verify CSRF token authenticity and 401 unauthorized message. It is redirecting back to log in page even though valid user.</p>
  
  <p>I have tried many solutions but still could not figure out the problem.
  I checked my params and it is sending authencity token which was supposed to raise WARNING: Can't verify CSRF token authenticity issue.</p>
  
  <p>This is my log file</p>
  
  <pre><code>Started POST "/admin/sign_in" for 127.0.0.1 at 2013-06-20 13:12:27 +0545
  Processing by Devise::SessionsController#create as HTML
  Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"YWAa7xOf+u0ButjnaE/kz5RmL3SZKFs
  x51pFbMxDqiw=", "admin"=&gt;{"email"=&gt;"shobhab@gmail.com", "password"=&gt;"[FILTERED]"}}
  
  WARNING: Can't verify CSRF token authenticity
  
  Admin Load (0.7ms)  SELECT `admins`.* FROM `admins` WHERE `admins`.`email` = 'shobhab@gm                          ail.com' LIMIT 1
  (0.3ms)  BEGIN
  (0.6ms)  UPDATE `admins` SET `last_sign_in_at` = '2013-06-20 07:27:20', `current_sign_i                          n_at` = '2013-06-20 07:27:28', `sign_in_count` = 37, `updated_at` = '2013-06-20 07:27:28' WHERE `admins`.`id` =      4
  (19.0ms)  COMMIT
  Redirected to home page
  Completed 302 Found in 179ms (ActiveRecord: 0.0ms)
  Started GET "/" for 127.0.0.1 at 2013-06-20 13:12:28 +0545
  Processing by Admin::DashboardController#index as HTML
  Completed 401 Unauthorized in 1ms
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <p>It's the form generated by devise</p>
  
  <pre><code>&lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; session_path(resource_name), :html =&gt; {:id =&gt; "login_    form"}) do |f| %&gt;
       &lt;h2&gt;Log in to your account:&lt;/h2&gt;
       &lt;%= f.label :email, 'Email:' %&gt;
       &lt;%= f.text_field :email, :class =&gt; "login" %&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;%= f.label :password, 'Password:' %&gt;
      &lt;%= f.password_field :password, :class =&gt; "login" %&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;div class="pagination-right"&gt;
    &lt;%= f.submit "sign in"%&gt;
      &lt;%= link_to "Forgot Password?", new_admin_password_path %&gt;
      &lt;/div&gt;
      &lt;p class="hr"&gt;Don't have an account?&lt;/p&gt;
      &lt;p&gt;Please contact your Admin or contact Talintel Support&lt;/p&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>In the hidden field it is generating authenticity token</p>
  
  <pre><code>&lt;div style="margin:0;padding:0;display:inline"&gt;
  &lt;input type="hidden" value="✓" name="utf8"&gt;
  &lt;input type="hidden" value="6yM4gkyWC94ej1X2Wzn/l17xTpIymsx9wCEuw5aOJbQ=" name="authenticity_token"&gt;
  &lt;/div&gt;
  </code></pre>