Yii2 make session works on all actions of one controller?
<p>In my SiteContoller I need to access the session on almost every action.
but I find write </p>

<pre><code>$session = Yii::$app-&gt;session;
$session-&gt;open();
</code></pre>

<p>duplicate the same code on every action of the same controller is annoying.
anyway to solve this???</p>