Remember login with OmniAuth

寵の児 提交于 2019-12-12 10:24:21

问题


Is there an easy way to implement "remember me" functionality with OmniAuth? I'm using Facebook, Identity and LinkedIn, and I'm looking for a way to keep the user logged in to my site across sessions.


回答1:


Basically you set another cookie on the client which persists the userid. Then use that userid to sign the user in (or at least recognise them) on subsequent visits. Remember Omniauth just does authentication, not the session management stuff so you need to do this outside Omniauth.

Look at the answer by gareth-simpson to this question: Implementation of "Remember me" in a Rails application



来源:https://stackoverflow.com/questions/10497231/remember-login-with-omniauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!