如何使authlog使用cookie而不是会话

时间:2012-06-29 10:16:34

标签: ruby-on-rails nginx authlogic squid

我们有一个使用rails 3.0.4和authlogic的站点。我们使用ngnix来处理前端,我正在尝试使用squid在nginx和unicorns之间进行缓存。我试图不为登录用户缓存页面,我这样做是通过跟踪user_credentials cookie,但是鉴于authlogic实际上是根据会话中存储的值进行授权。用户(或浏览器,感谢safari)可以删除该cookie,并允许登录用户将其页面放入缓存中,这会让人感到难过。

那么如何在user_credential cookie上而不是在会话上进行authlogic身份验证。

我认为这是相关的代码:

# Authlogic gem
acts_as_authentic do |config|
  config.transition_from_restful_authentication = true
  config.transition_from_crypto_providers = Authlogic::CryptoProviders::Sha1
  config.validates_length_of_password_field_options = {:on => :update, :minimum => 6, :if => :has_no_credentials?}
  config.validates_length_of_password_confirmation_field_options = {:on => :update, :minimum => 6, :if => :has_no_credentials?}
end

0 个答案:

没有答案
相关问题