2012-03-23 48 views
3

我使用的設計(1.5.3)和區長(1.1.1),我並不需要更新用戶登錄後的session_id /註冊監獄長:續約選項

https://github.com/hassox/warden/blob/master/lib/warden/proxy.rb#L160

if opts[:store] != false && opts[:event] != :fetch 
    options = env[ENV_SESSION_OPTIONS] 
    options[:renew] = true if options 
    session_serializer.store(user, scope) 
    end 

轉儲選項:

options {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :coder=># Rack::Session::Cookie::Base64::Marshal:0x00000004f50a10>, id=> "56d54b1b9820ee044151fdb4fdcb89db"} 

如何配置devise/warden不將選項[:renew]設置爲true?

回答

2

試試這個:

env['rack.session.options'][:renew] = false 
1
Warden::Manager.after_set_user do |user,auth,opts| 
    auth.env["rack.session.options"][:renew] = false 
end 
+0

出現這種情況後,典獄長已經renwed會話ID。將無法工作。 – Discorick 2016-03-28 20:59:15