0

To find a user session in authlogic, you call UserSession.find (or whatever you named UserSession). Is the ability to find the correct UserSession without providing a parameter (something like UserSession.find(params['session_id']) a Rails thing or did authlogic overwrite the find functionality?

Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196

1 Answers1

1

UserSession isn't an ActiveRecord model. Instead, it inherits from Authlogic::Session::Base. This provides it with methods which are similar to an ORM. The authlogic docs state:

What if creating sessions worked like an ORM library on the surface…

The find method is defined within the authlogic codebase here, which just probes the session store (usually a cookie) to see if the user is logged in.

Nick Colgan
  • 5,488
  • 25
  • 36