典狱长:续订选项

Iva*_*nko 5 ruby ruby-on-rails devise warden

我正在使用 devise (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
Run Code Online (Sandbox Code Playgroud)

转储选项:

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

如何配置 devise/warden 不将 options[:renew] 设置为 true ?

小智 2

尝试这个:

env['rack.session.options'][:renew] = false
Run Code Online (Sandbox Code Playgroud)