title: how to access $_SESSION variable in symfony2
body: <p>I am trying to do the following:</p>
  
  <pre><code>        $postfields = array_merge($_SERVER, array("p"=&gt;$_POST, "s"=&gt;$_SESSION));
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_POST, count($postfields));
          curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
          curl_setopt($ch, CURLOPT_HEADER, 0);
          curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
          curl_setopt($ch, CURLOPT_TIMEOUT, 5);
  </code></pre>
  
  <p>why isn't this working? It always gives me an error that $_SESSION does not exist.</p>