Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session::timeout does not effect #5880

Closed
mitalcoi opened this issue Nov 3, 2014 · 7 comments
Closed

Session::timeout does not effect #5880

mitalcoi opened this issue Nov 3, 2014 · 7 comments
Labels
status:to be verified Needs to be reproduced and validated.

Comments

@mitalcoi
Copy link
Contributor

mitalcoi commented Nov 3, 2014

my config:

...
        'session' => [
            'class' => 'yii\web\Session',
            'cookieParams' => ['httponly' => true, 'lifetime' => 3600 * 4],
            'timeout' => 3600*4,
            'useCookies' => true,
        ],
...

But I find myself logouted after 20-40 minutes

@samdark samdark added the status:to be verified Needs to be reproduced and validated. label Nov 3, 2014
@samdark samdark added this to the 2.0.x milestone Nov 3, 2014
@martingeorg
Copy link

Try changing session.gc_maxlifetime http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime in Your php.ini to something bigger and see if the problem persists.

@mitalcoi
Copy link
Contributor Author

mitalcoi commented Nov 3, 2014

after direct setting in php.ini problem gone

@qiangxue
Copy link
Member

qiangxue commented Nov 3, 2014

It is because the session is being lazily loaded. You may put it in bootstrap to ensure timeout is set for every request.

@qiangxue qiangxue closed this as completed Nov 3, 2014
@cebe cebe removed this from the 2.0.x milestone Nov 3, 2014
@ghost
Copy link

ghost commented Nov 3, 2015

@qiangxue Sorry, but may i ask what do you mean exactly when you say to put it in bootstrap? do you mean the index.php, where yii is booted?

@samdark
Copy link
Member

samdark commented Nov 3, 2015

@ghost
Copy link

ghost commented Nov 3, 2015

genius! thank you very much for the fast reply! I didn't know about that property!

@vishwasrao
Copy link

Hi,
Following code works fine for me.
in components of my config/main.php

'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => false,
          **  'authTimeout' => 30, //Seconds **
        ],

This is timing out session & coming back to login screen after inactivity for 30 secods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated.
Projects
None yet
Development

No branches or pull requests

6 participants