【问题标题】:Laravel ... Automatically execute a script after few hoursLaravel ...几个小时后自动执行脚本
【发布时间】:2015-04-20 15:44:25
【问题描述】:

是否可以使用 laravel 在几个小时后自动注销用户,比如 10,即使浏览器关闭并且用户不手动注销。

【问题讨论】:

标签: php laravel-4


【解决方案1】:

在 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,

将“生命周期”设置为您希望会话处于活动状态的时间,以分钟为单位。例如如果您想要 10 小时,请将其设置为 600。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-30
    • 2017-02-18
    • 2019-05-06
    • 1970-01-01
    相关资源
    最近更新 更多