我正在使用设计(1.5.3)和warden(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?
答案 0 :(得分:2)
试试这个:
env['rack.session.options'][:renew] = false
答案 1 :(得分:1)
Warden::Manager.after_set_user do |user,auth,opts|
auth.env["rack.session.options"][:renew] = false
end