Session variable not destroyed on timeout?
<p>I have the following code in config</p>

<pre><code>'user' =&gt; [
            'identityClass' =&gt; 'common\models\UserCustomer',
            'authTimeout' =&gt; 30,
        ],
</code></pre>

<p>after 30 second of inactivity, and I refresh the browser the account logged out indicate with login link appear, but some variable which display from session remain exists in my view.</p>

<p>Here is my partial code in view</p>

<pre><code>&lt;?php
                        $lsproduk = Yii::$app-&gt;session['produkcart'];
                        //echo "counter awal Yii::$app-&gt;session['counter']";
                        if(isset (Yii::$app-&gt;session['counter']))
                        {

                            foreach($lsproduk as $key =&gt; $produk){

                                if(VwProdukAgent::find()-&gt;where(['produk_agen_id' =&gt; $produk-&gt;produk_agen_id])-&gt;andWhere(['is_active_produk_agent' =&gt; false])-&gt;count() &gt; 0){
                                    unset($lsproduk[$key]);
                                }
                            }

                            Yii::$app-&gt;session['produkcart'] = $lsproduk;

                            $lsproduk = Yii::$app-&gt;session['produkcart'];

                            Yii::$app-&gt;session['counter'] = count($lsproduk);

                            $counter = Yii::$app-&gt;session['counter'];
                            //display total product
                            echo "&lt;span class='cart-count'&gt;$counter&lt;/span&gt;&lt;/a&gt;";

                        } 
                    ?&gt;
</code></pre>

<p>Refresh few time doesn't solve the problem.</p>

<p>It's different when I normaly press logout button, there is no variable displayed in view.</p>

<p>for your information my current application is e-commerce, the variable which displayed on timeout is total product on cart which is from session. it's different when I normally press logout, the cart is empty of course because session get destroyed on logout method.</p>

<p>Is something wrong? let me know about it.</p>

<p><em>UPDATED</em></p>

<p>Then how I can delete other session variable on timeout?</p>