Rails - Devise signin(@user) is not working in session
<p>I used a customized controller to do signin as following:</p>

<pre><code>class Users::SessionsController &lt; Devise::SessionsController
  def create
    # super
    @user = User.where(:email =&gt; user_params[:email]).first
    if @user.valid_password? user_params[:password]
      sign_in(@user)
      @current_user = @user # even set current user doesn't make sense

      redirect_to '/'
    else
      render :new
    end
  end
end
</code></pre>

<p>I also tried using <code>super</code>, in database level the user is verified but devise never set session. In both two cases I see record is updated in database:</p>

<pre><code>UPDATE `users` SET `current_sign_in_at` = '...', `last_sign_in_at` = '...', `sign_in_count` = .., `updated_at` = '...' WHERE `users`.`id` = 1
</code></pre>