ruby on rails - Devise 'remember me' to prevent login between sessions? -
(i've seen other questions here, , i've followed documentation here, still doesn't work)
currently users have sign in every time close browser. want them kept logged in indefinitely.
i tried using devise 'remember me' function, doesn't seem work.
i see cookie created, called 'remember_user_token', doesn't seem have effect on login.
all config.remember_for settings disabled
what doing wrong?
class authenticationscontroller < applicationcontroller include devise::controllers::rememberable def create omniauth = request.env["omniauth.auth"] authentication = omniauth['uid'].present? ? authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid']) : nil ... respond @user end def respond(user) user.remember_me = true sign_in user, event: :authentication remember_me(user) end ... end
Comments
Post a Comment