title: Symfony 3.4 $_SESSION in controller
body: <p>I have an app that starts in a <code>.php</code> file.
  In this file I do some work, but at the end I do two things, I generate a value and save in <code>$_SESSION</code> and redirect to other route:</p>
  
  <p>This <code>php</code> file is out of Symfony folder:</p>
  
  <pre><code>&lt;?php
  session_start();
  
  ...Do some work
  
  $_SESSION['token'] = 'some value';
  header ("Location: new direction");
  ?&gt;
  </code></pre>
  
  <p>The redirection,redirects to symfony folder,and starts the symfony part going to my <code>src/AppBundle/Controller/MainController</code>.</p>
  
  <p>And in the first action that is processed in this controller I need to access the value of <code>$_SESSION['token']</code> to do some work with this value in the controller action. This is the controller:</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\Routing\Annotation\Route;
  
  class MainController extends Controller
  {
      public function homepageAction(Request $request)
      {
          dump($_SESSION);
          die;
  
          ...Some work
      }
  }
  ?&gt;
  </code></pre>
  
  <p>The <code>dump($_SESSION)</code> shows this:</p>
  
  <p><a href="https://i.stack.imgur.com/LIQz3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LIQz3.png" alt="enter image description here"></a></p>
  
  <p>But I can´t find my <code>$_SESSION['token']</code></p>
  
  <p>Do I need to use some Symfony component to access the PHP $_SESSION values inside a controller?</p>
  
  <p>Or How can I access <code>$_SESSION['token']</code> in the controller?</p>