title: Yii2 - yii\console\Application::getSession()
body: <p>I am trying to run a console application from the terminal, but am getting this error </p>
  
  <pre><code>Calling unknown method: yii\console\Application::getSession()
  </code></pre>
  
  <p>this is the controller</p>
  
  <pre><code>class BeanstalkController extends \yii\console\Controller {
  
  public function actionIndex() {
  
      echo 'this is console action';
  } }
  </code></pre>
  
  <p>and this is the console config  </p>
  
  <pre><code>return [
  'id' =&gt; 'app-console',
  'basePath' =&gt; dirname(__DIR__),
  'bootstrap' =&gt; ['log'],
  'controllerNamespace' =&gt; 'console\controllers',
  'modules' =&gt; [],
  'components' =&gt; [
      'user' =&gt; [
          'class' =&gt; 'yii\web\User',
          'identityClass' =&gt; 'common\models\Users',
          'enableAutoLogin' =&gt; TRUE,
      ],
      'log' =&gt; [
          'targets' =&gt; [
              [
                  'class' =&gt; 'yii\log\FileTarget',
                  'levels' =&gt; ['error', 'warning'],
              ],
          ],
      ],
  ],
  'params' =&gt; $params,];
  </code></pre>
  
  <p>I tried to remove the session from the config but am still getting the session error.</p>
  
  <p>Anyone can help ?</p>