webster
webster

Reputation: 4012

User logged out automatically when browser is closed when using devise gem

I am using devise gem for authentication of my rails application. The issue is that the user gets logged out when he closes the browser. I want the user to be logged in until he clicks the log out button.

Upvotes: 2

Views: 909

Answers (1)

webster
webster

Reputation: 4012

The issue was resolved by adding a 3 line code to my user.rb file :)

class User < ActiveRecord::Base
  devise :rememberable
  ....     
  def remember_me
    true
  end
end

Upvotes: 3

Related Questions