title: symfony 2 how to send data when redirecting
body: <p>I fetch an object from a database and then I want to make a redirect to the other controller and send there that object:</p>
  
  <pre><code>$user = $this-&gt;getDoctrine()-&gt;getRepository('ShopMyShopBundle:Register')-&gt;find($id);
  
  return $this-&gt;redirect($this-&gt;generateUrl('ShopMyShopBundle_homepage'), array('user' =&gt; $user));
  </code></pre>
  
  <p>How Can I get an object after redirecting and send to a template in the other controller function which looks like this:</p>
  
  <pre><code>public function indexAction()
  {
      return $this-&gt;render('ShopMyShopBundle:Main:index.html.twig');
  }
  </code></pre>