Yii2 secure connection cookie login

Cookie Login via https timesout. When i try the cookie login locally it works.Locally i dont have the secure connection set up.When I upload to production which requires https, looks like the session timesout.

I have enabled autologin and used :

Yii::$app->user->login($identity,$autologin ? 36002430 : 0);

Try it with User component configuration with cookie secure parameter:

// ...

'identityCookie' => [

    'name'     => '_identity', 

    'httpOnly' => true,

    'secure'   => true


I tried the above same issue.The session times out.Surprisingly it works on my local.