1

In Yii2,I have in my config/main.php

'components' => [
    'user' => [
        'identityClass' => 'common\models\User',
        'authTimeout' => 43200,
        'loginUrl' => null,
    ],
...
]

when i am trying to see my authTimeout variable in my whole system is ok and everything works fine except my session get expire before authTimeout.I am using access_token for login because my frontend is angular and also using mdmsoft/yii2-admin for RBAC. And i am not getting,why i am logging out before my authTimeout?
Thanks

Mad Adh
  • 95
  • 9

1 Answers1

1

It is probably because globally, session.gc_maxlifetime is set to be lower than what you have set in your application. You can use echo ini_get("session.gc_maxlifetime"); to get the current value.

This answer discusses how to increase that within your application. Note, that some hosts tend to override the session timeout value set in php.ini, as discussed in this thread. Even if that is the case, this answer would help.

If this is not the case, then please provide more information about your script, host and php configuration. I will update the answer accordingly.

Community
  • 1
  • 1
Gogol
  • 3,033
  • 4
  • 28
  • 57
  • my session.gc_maxlifetime is 1440 which means 24 minutes but i am logged out not in specific time.I have something like timer running everytime when i click some activity.Sometime i see i was not logged out in 4 hours also some time in 1 hours.I see my authTime out inside my application is same as i have in config.When i go to my yii2soft inside web to User.php i have duration is 216000.If i see my Expire time is browser is also after 12 hours.Is it possible like in my every request my session.gc_maxlifetime will be add to my previous session(ie.session.gc_maxlifetime)? – Mad Adh May 19 '16 at 15:32