Skip to content

Commit

Permalink
Don't write nil values to default session options hash
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Dec 16, 2008
1 parent 95c839b commit 9a733f6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions actionpack/lib/action_controller/session_management.rb
Expand Up @@ -17,9 +17,15 @@ def self.new(app)
cgi_options = ActionController::Base.session_options cgi_options = ActionController::Base.session_options
options = cgi_options.symbolize_keys options = cgi_options.symbolize_keys
options = DEFAULT_OPTIONS.merge(options) options = DEFAULT_OPTIONS.merge(options)
options[:path] = options.delete(:session_path) if options.has_key?(:session_path)
options[:key] = options.delete(:session_key) options[:path] = options.delete(:session_path)
options[:httponly] = options.delete(:session_http_only) end
if options.has_key?(:session_key)
options[:key] = options.delete(:session_key)
end
if options.has_key?(:session_http_only)
options[:httponly] = options.delete(:session_http_only)
end


if store = ActionController::Base.session_store if store = ActionController::Base.session_store
store.new(app, options) store.new(app, options)
Expand Down

0 comments on commit 9a733f6

Please sign in to comment.