Permalink
Browse files

Allow AR Session Store to be renewed

  • Loading branch information...
josevalim committed Nov 11, 2010
1 parent 2651a87 commit 9c9f416d398c47dd2297fa5cc4025e0800d32212
@@ -27,6 +27,12 @@ def call_reset_session
head :ok
end
+ def renew
+ env["rack.session.options"][:renew] = true
+ session[:foo] = "baz"
+ head :ok
+ end
+
def rescue_action(e) raise end
end
@@ -64,6 +70,20 @@ def teardown
end
end
end
+
+ define_method("test_renewing_with_#{class_name}_store") do
+ with_store class_name do
+ with_test_route_set do
+ get '/set_session_value'
+ assert_response :success
+ assert cookies['_session_id']
+
+ get '/renew'
+ assert_response :success
+ assert_not_equal [], headers['Set-Cookie']
+ end
+ end
+ end
end
def test_getting_nil_session_value
@@ -321,6 +321,7 @@ def destroy_session(env, session_id, options)
if sid = current_session_id(env)
Base.silence do
get_session_model(env, sid).destroy
+ env[SESSION_RECORD_KEY] = nil
end
end

0 comments on commit 9c9f416

Please sign in to comment.