Authlogic and multiple sessions for the same user Authlogic and multiple sessions for the same user ruby-on-rails ruby-on-rails

Authlogic and multiple sessions for the same user


Ok so the perishable token was absolutely not the right path ;)

We "just" need to reset the persistence token every time a user logs in or logs out.With this in my UserSession model, every user gets logged off from any other session when logging in.

class UserSession < Authlogic::Session::Base    before_destroy :reset_persistence_token    before_create  :reset_persistence_token    def reset_persistence_token        record.reset_persistence_token    end end