同一用户的Authlogic和多个会话

我正在使用Authlogic来管理我的应用程序中的会话。
但是,默认情况下,authlogic允许用户从不同的计算机多次登录。
我不希望这样(用户付费获取访问权限,我希望避免用户共享其帐户)。

查看Authlogic文档,我发现了perishable_token。 但是当试图实现它时,我只是得到一个错误,说persistence_token是必需的(当它不应该是因为我使用易腐烂的)。

你会如何使用Authlogic的function?

谢谢 :)

好吧,易腐坏的令牌绝对不是正确的道路;)

我们“只需”每次用户登录或注销时都需要重置持久性令牌。 在我的UserSession模型中,每个用户在登录时都会从任何其他会话中注销。

 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