Skip to content
This repository
Browse code

Session cookie header should always be set if :expire_after option is…

… specified
  • Loading branch information...
commit 2ae8d3079b96d343f8cea8513929d656013f880e 1 parent 9714a9b
Pratik authored January 28, 2009
6  actionpack/lib/action_controller/session/abstract_store.rb
@@ -102,8 +102,10 @@ def call(env)
102 102
         response = @app.call(env)
103 103
 
104 104
         session_data = env[ENV_SESSION_KEY]
105  
-        if !session_data.is_a?(AbstractStore::SessionHash) || session_data.send(:loaded?)
106  
-          options = env[ENV_SESSION_OPTIONS_KEY]
  105
+        options = env[ENV_SESSION_OPTIONS_KEY]
  106
+
  107
+        if !session_data.is_a?(AbstractStore::SessionHash) || session_data.send(:loaded?) || options[:expire_after]
  108
+          session_data.send(:load!) if session_data.is_a?(AbstractStore::SessionHash) && !session_data.send(:loaded?)
107 109
 
108 110
           if session_data.is_a?(AbstractStore::SessionHash)
109 111
             sid = session_data.id
6  actionpack/lib/action_controller/session/cookie_store.rb
@@ -93,12 +93,14 @@ def call(env)
36  actionpack/test/controller/session/cookie_store_test.rb
@@ -6,13 +6,11 @@ class CookieStoreTest < ActionController::IntegrationTest
@@ -177,6 +175,36 @@ def test_persistent_session_id

0 notes on commit 2ae8d30

Please sign in to comment.
Something went wrong with that request. Please try again.