session timeout

Hi everybody!

i try to change the session timeout via my config:




'session' => [

  'timeout' => 60,

],



unfortunately it doesn’t work. as i googled, i found the reply, that it’s due to lazy loading. and that the it should be loaded in the yii bootstrap. the problem is, i don’t understand, what is ment with yii bootstrap.

is it the index.php ?

here is the source, with the same problem.

else maybe a solution would be to create a new class extending yii\web\Session with my custom timeout as default value and then loading it via config, like :




'session' => [

  'class' => 'app\web\MySession',

  'timeout' => 60,

],



would that solve the problem? or would the lazy loading problem persist?

thank you for an advice.

ok, i asked for details on the github issue, mentioned above (link also above).

i got the reply with a link to the bootstrap property:

http://www.yiiframework.com/doc-2.0/guide-structure-applications.html#bootstrap

that was exactly, what i was looking for. i will test it later.

concerning the extension of the session class and adapting my own class. i tried that, but same problem - also that seems to be logic, because it doesn’t change the lazy loading behaviour.

but i think the bootstrap property will work for me.

problem solved for me. if it worked maybe i will give you an update with a code snippet.

You have also to check session timeout on php configuration of the webserver.

yes thank you, i’m aware of the php config, but i was interested in the yii-bootstrap solution.