aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-01-01 01:30:28 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-01-01 01:30:28 +0000
commitfe7995f718098d3979e01af8957c910eb0d5b3e6 (patch)
tree7698b2c68af8eb2fa461e347632e78b38466e228 /actionpack
parent0f048a5c9867b2e991ad540222c8d8188f5a24fc (diff)
downloadrails-fe7995f718098d3979e01af8957c910eb0d5b3e6.tar.gz
rails-fe7995f718098d3979e01af8957c910eb0d5b3e6.tar.bz2
rails-fe7995f718098d3979e01af8957c910eb0d5b3e6.zip
Merge [5822] from 1.2 (oops, wrong order).
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5823 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/cgi_process.rb23
1 files changed, 14 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb
index 1ee0d60e07..292877d93b 100644
--- a/actionpack/lib/action_controller/cgi_process.rb
+++ b/actionpack/lib/action_controller/cgi_process.rb
@@ -107,16 +107,21 @@ module ActionController #:nodoc:
@session = Hash.new
else
stale_session_check! do
- if session_options_with_string_keys['new_session'] == true
- @session = new_session
- else
- begin
+ case value = session_options_with_string_keys['new_session']
+ when true
+ @session = new_session
+ when false
+ 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
+ when nil
@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
+ else
+ raise ArgumentError, "Invalid new_session option: #{value}"
end
@session['__valid_session']
end