Reputation: 4012
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
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