aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rwxr-xr-xactionpack/lib/action_controller/base.rb2
-rw-r--r--actionpack/test/controller/session_management_test.rb11
3 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 557ddfb633..b315840b5b 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* session_enabled? works with session :off. #6680 [Catfish]
+
* Added :port and :host handling to UrlRewriter (which unified url_for usage, regardless of whether it's called in view or controller) #7616 [alancfrancis]
* Allow send_file/send_data to use a registered mime type as the :type parameter #7620 [jonathan]
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 39ffb06212..a7b702cd3e 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -585,7 +585,7 @@ module ActionController #:nodoc:
end
def session_enabled?
- request.session_options[:disabled] != false
+ request.session_options && request.session_options[:disabled] != false
end
# View load paths for controller.
diff --git a/actionpack/test/controller/session_management_test.rb b/actionpack/test/controller/session_management_test.rb
index 6e100c0c37..63917565ef 100644
--- a/actionpack/test/controller/session_management_test.rb
+++ b/actionpack/test/controller/session_management_test.rb
@@ -142,4 +142,15 @@ class SessionManagementTest < Test::Unit::TestCase
get :tell
assert_equal "does not have cached associations", @response.body
end
+
+ def test_session_is_enabled
+ @controller = TestController.new
+ get :show
+ assert_nothing_raised do
+ assert_equal false, @controller.session_enabled?
+ end
+
+ get :tell
+ assert @controller.session_enabled?
+ end
end