Work round session expiry bug in rails 2.3.11

Rails uses :expire_after in the session options to specify when a
sesssion should expire, but when Rack sets the cookie it expects to
see :expires in the cookie options but Rails 2.3.11 fails to do the
conversion so doesn't set the cookie expiry.

To work around this, we set both options in the session options...
This commit is contained in:
Tom Hughes 2011-06-02 10:23:22 +01:00
parent c4f7a8346a
commit 26b217c0ad

View file

@ -22,9 +22,8 @@ module SessionPersistence
def _persist_session
if session[session_persistence_key]
request.session_options = request.session_options.dup
request.session_options[:expires] = Time.now + session[session_persistence_key]
request.session_options[:expire_after] = session[session_persistence_key]
request.session_options.freeze
end
end
end