title: app.user.username in twig returns unable to add global
body: <p>as per the documentation:</p>
  
  <pre><code>http://symfony.com/doc/current/book/security.html#retrieving-the-user-object
  </code></pre>
  
  <p>I am trying to use twig to check to see if the user is authenticated</p>
  
  <p>when i put in my twig templates:</p>
  
  <pre><code>{{ app.user.username }}
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>LogicException: Unable to add global "app" as the runtime or the extensions have already been initialized.
  </code></pre>
  
  <p><strong>EDIT:</strong> Please find as per below the composer.json contents</p>
  
  <pre><code>{
      "name": "symfony/framework-standard-edition",
      "description": "The \"Symfony Standard Edition\" distribution",
      "autoload": {
          "psr-0": { "": "src/" }
      },
      "require": {
          "php": "&gt;=5.3.3",
          "symfony/symfony": "2.1.*",
          "doctrine/orm": "&gt;=2.2.3,&lt;2.4-dev",
          "doctrine/doctrine-bundle": "1.0.*",
          "twig/extensions": "1.0.*@dev",
          "symfony/assetic-bundle": "2.1.*",
          "symfony/swiftmailer-bundle": "2.1.*",
          "symfony/monolog-bundle": "2.1.*",
          "sensio/distribution-bundle": "2.1.*",
          "sensio/framework-extra-bundle": "2.1.*",
          "sensio/generator-bundle": "2.1.*",
          "jms/security-extra-bundle": "1.2.*",
          "jms/di-extra-bundle": "1.1.*",
          "kriswallsmith/assetic": "1.1.*@dev",
          "doctrine/data-fixtures": "dev-master",
          "doctrine/doctrine-fixtures-bundle": "dev-master"
      },
      "scripts": {
          "post-install-cmd": [
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
          ],
          "post-update-cmd": [
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
              "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
          ]
      },
      "extra": {
          "symfony-app-dir": "app",
          "symfony-web-dir": "web"
      }
  }
  </code></pre>