title: Yii2 - flash not visible after redirect
body: <p>Flash messages seems to be broken in case of redirecting. I made simple test code:</p>
  
  <pre><code>public function actionTest($test = 0) {
      if($test == 0) {
          Yii::$app-&gt;getSession()-&gt;addFlash('success', 'Follow the white rabbit');
          return Yii::$app-&gt;getResponse()-&gt;redirect(array('test', 'test' =&gt; 1));
      }
      return $this-&gt;render('test', []);
  }
  </code></pre>
  
  <p>I call the action without parameter, it adds a flash and redirects. When it renders the page - flash is not present.</p>
  
  <p>The view part is fine, because if I set flash and make a render without redirect it is rendered properly.</p>
  
  <p>Why?</p>
  
  <p>EDIT:
  Layout view code:</p>
  
  <pre><code>&lt;?php
  
  use frontend\widgets\Alert;
  
  $this-&gt;beginPage();
  echo $this-&gt;render('partials/head');
  ?&gt;
  
  &lt;body class="no-sidebar"&gt;
      &lt;?= $this-&gt;beginBody() ?&gt;
      &lt;div id="header"&gt;
          &lt;?= $this-&gt;render('partials/top') ?&gt;
          &lt;?= $this-&gt;render(Yii::$app-&gt;user-&gt;isGuest ? 'menus/guest' : 'menus/registered') ?&gt;
      &lt;/div&gt;
      &lt;!-- Main --&gt;
      &lt;div id="main"&gt;
          &lt;?= Alert::widget() ?&gt;
          &lt;?= $content ?&gt;
  
      &lt;/div&gt;
  
      &lt;?= $this-&gt;render('partials/footer') ?&gt;
      &lt;?= $this-&gt;endBody() ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;?php $this-&gt;endPage() ?&gt;
  </code></pre>