How can I get authlogic to use a Rails session instead of my own cookie?

I would like authogic to never set the user_credentials cookie and use only the standard Rails session cookie.

I see that Session included in Authlogic::Session::Session::Base after Cookies . If I log in to my application and then delete the user_credentials cookie, I remain in the system anyway. So what does authlogic seem to store credentials in both places and check both places? Or ignore the cookie, but still setting it up? How can I set it or not link to the user_credentials cookie?

+6
ruby-on-rails cookies session authlogic
source share
2 answers

According to the answer to my question here ...

How to remove callbacks inserted by provider code?

... the answer to this question is to do this above my UserSession definition:

 Authlogic::Session::Base.after_save.delete_if{ |callback| callback.method == :save_cookie } class UserSession < Authlogic::Session::Base end 
+5
source share

If you use authlogic for providers, you can disable the use of the user_credentials cookie and change the code to the save_cookie method to "authlogic-2.1.5 / lib / authlogic / session / cookies.rb"

+1
source share

All Articles