<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
 module ActionController #:nodoc:
+  # TODO: Cookies and session variables set in render_component that happens inside a view should be copied over.
   module Components #:nodoc:
     def self.append_features(base)
       super
@@ -14,16 +15,16 @@ module ActionController #:nodoc:
 
     protected
       def render_component(options = {}) #:doc:
-        response = component_response(options)
-        logger.info &quot;Rendering component (#{options.inspect}): &quot;
+        response = component_response(options, true)
+        logger.info &quot;Start rendering component (#{options.inspect}): &quot;
         result = render_text(response.body, response.headers[&quot;Status&quot;])
         logger.info(&quot;\n\nEnd of component rendering&quot;)
         return result
       end
   
     private
-      def component_response(options)
-        component_class(options).process(component_request(options), @response)
+      def component_response(options, reuse_response = false)
+        component_class(options).process(component_request(options), reuse_response ? @response : component_response)
       end
     
       def component_class(options)
@@ -31,12 +32,16 @@ module ActionController #:nodoc:
       end
       
       def component_request(options)
-        component_request = @request.dup
+        component_request = Marshal::load(Marshal::dump(@request))
         component_request.send(
           :instance_variable_set, :@parameters, 
           (options[:params] || {}).merge({ &quot;controller&quot; =&gt; options[:controller], &quot;action&quot; =&gt; options[:action] })
         )
         return component_request
       end
+      
+      def component_response
+        Marshal::load(Marshal::dump(@response))
+      end
   end
 end</diff>
      <filename>actionpack/lib/action_controller/components.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>752f9ab8739bef4d7acab21af5858f5d5d9db6eb</id>
    </parent>
  </parents>
  <author>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </author>
  <url>http://github.com/chriseppstein/rails/commit/e2724aa1856253f4fc48ddc251583042c5f06029</url>
  <id>e2724aa1856253f4fc48ddc251583042c5f06029</id>
  <committed-date>2005-02-22T06:14:42-08:00</committed-date>
  <authored-date>2005-02-22T06:14:42-08:00</authored-date>
  <message>Made the sharing of request and response safer

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de</message>
  <tree>65fe55277e080282e6e2306f31a23d369a854aa1</tree>
  <committer>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </committer>
</commit>
