Session varriable become empty


I have store some values in session variable something like below

$session = Yii::$app->session;


now,i am accessing this session variable through out my below

$admin = Yii::$app->session->get(‘adminUser’);

it’s working fine to some extend but after some time " Yii::$app->session->get(‘adminUser’);" return blank value.if session has timed out then it should logged me out as well but however i am still logged in.

any solutions?

i have got the solution i set enableauto login to false as it was allowing user to login based on cookie rather than even after session is expired user stay logged in but session varriables became blank as session has been expired