Permalink
Browse files

Don't write nil values to default session options hash

  • Loading branch information...
1 parent 95c839b commit 9a733f6c640cb3c4d474ecf44dd62ab73e351fd5 @josh josh committed Dec 16, 2008
Showing with 9 additions and 3 deletions.
  1. +9 −3 actionpack/lib/action_controller/session_management.rb
@@ -17,9 +17,15 @@ def self.new(app)
cgi_options = ActionController::Base.session_options
options = cgi_options.symbolize_keys
options = DEFAULT_OPTIONS.merge(options)
- options[:path] = options.delete(:session_path)
- options[:key] = options.delete(:session_key)
- options[:httponly] = options.delete(:session_http_only)
+ if options.has_key?(:session_path)
+ options[:path] = options.delete(:session_path)
+ 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
store.new(app, options)

0 comments on commit 9a733f6

Please sign in to comment.