diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-01 01:13:09 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-01 01:13:09 +0000 |
commit | 0f048a5c9867b2e991ad540222c8d8188f5a24fc (patch) | |
tree | bbd84a7c93e344975531ca5a91e27c11ddaff552 /actionpack/lib | |
parent | 0a06ffc08e918383e4bc81eaa68b512d763e97be (diff) | |
download | rails-0f048a5c9867b2e991ad540222c8d8188f5a24fc.tar.gz rails-0f048a5c9867b2e991ad540222c8d8188f5a24fc.tar.bz2 rails-0f048a5c9867b2e991ad540222c8d8188f5a24fc.zip |
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.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5820 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/cgi_process.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb index 47de1956cc..1ee0d60e07 100644 --- a/actionpack/lib/action_controller/cgi_process.rb +++ b/actionpack/lib/action_controller/cgi_process.rb @@ -110,7 +110,13 @@ module ActionController #:nodoc: 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 |