Reorder your Authlogic persistence callbacks
One thing lacking from ActiveSupport::Callbacks, imo, is a way to reorder callbacks.
For instance, it would be nice if you could define the order in which Authlogic (which uses ActiveSupport::Callbacks) tries to persist a session (ie ‘remember’ cookie, then ‘session’ cookie, then ‘http_auth’, and so on).
Here’s some code to put at the end of your session models to prioritize their callback chains…
For Rails 2:
For Rails 3:
(link)