Browse files

Merge [5820] from trunk.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b6af22e commit 0120b226ba3f91dba2e1e45b54fbef09844da8cf @jeremy jeremy committed Jan 1, 2007
Showing with 9 additions and 1 deletion.
  1. +2 −0 actionpack/CHANGELOG
  2. +7 −1 actionpack/lib/action_controller/cgi_process.rb
View
2 actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*1.13.0 RC2*
+* Set session to an empty hash if :new_session => false and no session cookie or param is present. CGI::Session was raising an unrescued ArgumentError. [Josh Susser]
+
* Fix assert_redirected_to bug where redirecting from a nested to to a top-level controller incorrectly added the current controller's nesting. Closes #6128. [Rick Olson]
* Ensure render :json => ... skips the layout. #6808 [Josh Peek]
View
8 actionpack/lib/action_controller/cgi_process.rb
@@ -110,7 +110,13 @@ def session
if session_options_with_string_keys['new_session'] == true
@session = new_session
else
- @session = CGI::Session.new(@cgi, session_options_with_string_keys)
+ begin
+ @session = CGI::Session.new(@cgi, session_options_with_string_keys)
+ # CGI::Session raises ArgumentError if 'new_session' == false
+ # and no session cookie or query param is present.
+ rescue ArgumentError
+ @session = Hash.new
+ end
end
@session['__valid_session']
end

0 comments on commit 0120b22

Please sign in to comment.