Hi,
i am a newbie to yii2.
i have made a code which stores subcategory in session temporarily before the query is executed but for some reason the session gets cleared automatically just after setting it.
$session = yii::$app->session;
if (!isset($session['subCategory']) || count($session['subCategory']) === 0) {
$session->set('subCategory', array($category));
}