Laravel 5.1配置会话生存期应用更改 [英] Laravel 5.1 Configuration Session Lifetime Apply Changes

查看:54
本文介绍了Laravel 5.1配置会话生存期应用更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是一个简单的问题.在我的laravel config/session.php 中,我将生命周期值从默认的2小时更改为:

simple question here. In my laravel config/session.php I have changed the lifetime value from the default 2 hours to this:

 /*
    |--------------------------------------------------------------------------
    | 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' => 1440,

    'expire_on_close' => true,

    /*

但是,即使这是我在服务器上拥有的东西,它仍然坚持默认的2小时课程.我可以通过查看cookie laravel_session 来验证这一点,该cookie总是在2小时内用完.

However, even though this is what I have on my server, it still sticks to the default 2 hour session. I can verify this by seeing the cookie laravel_session which always maxes out in 2 hours.

我想念什么?我需要更改以应用新的 lifetime 的单独的配置文件或值吗?

What am I missing? Is there a separate configuration file or value I need to change to apply my new lifetime?

显然,您不能期望 lifetime expire_on_close 选项都同时运行,因为它们利用两种不同类型的Cookie,但我仍然不明白为什么将 expire_on_close 设置为 true 为什么我的Cookie会在2小时内过期,而不是在浏览时会话结束了吗?

Well apparently you can't expect both the lifetime and the expire_on_close option to both be operating at the same time because they utilize two different types of cookies, but I still don't understand why if I have the expire_on_close set to true why my cookie is expiring in 2 hours rather than when the browsing session ends?

推荐答案

php artisan config:cache 将更改应用于配置文件!

php artisan config:cache applies changes to the configuration files!

这篇关于Laravel 5.1配置会话生存期应用更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆