【问题标题】:Laravel App kept logging users out [duplicate]Laravel App 不断将用户注销 [重复]
【发布时间】:2016-07-20 23:58:58
【问题描述】:

最近,我的 Laravel 网站让我在很短的时间内退出 - maybe 在大约 30 秒内...


我应该检查或调查什么?我该如何调试?


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' => 2,,我应该增加它吗?

还有什么可能导致应用退出?

【问题讨论】:

  • 在控制台查看错误(如果有)和 laravel 存储日志文件
  • 谷歌浏览器控制台?
  • lifetime => 2 表示 2 分钟 sessoin lfetime,因此每 2 分钟注销一次 - 所以是的 - 增加它 :)

标签: php laravel laravel-5


【解决方案1】:

它在 cmets 中说“指定您希望会话在到期之前保持空闲的分钟数”

/*
|--------------------------------------------------------------------------
| 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,

以上两小时后过期,你的两分钟后过期。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-18
    • 2016-02-13
    • 2015-06-23
    • 1970-01-01
    • 1970-01-01
    • 2014-08-08
    • 2016-08-22
    • 2017-11-08
    相关资源
    最近更新 更多