Laravel 不活动时间设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24133830/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 02:50:28  来源:igfitidea点击:

Laravel Inactivity time setting

laraveltimeoutlogout

提问by syraz37

When user logged-in and remains inactive, How many seconds after that system logouts the user automatically? How to change this setting?

当用户登录并保持非活动状态时,系统会在多少秒后自动注销用户?如何更改此设置?

回答by Jeemusu

Assuming you are using the session driver to handle your authentication, you can change the time period for an idle session to expire in the /app/config/session.phpfile.

假设您使用会话驱动程序来处理您的身份验证,您可以更改空闲会话在/app/config/session.php文件中到期的时间段。

/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/

'lifetime' => 120,

'expire_on_close' => false,