Laravel 5 会话生命周期

新手上路,请多包涵

根据 Laravel 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' => true,
'expired-session-redirect' => url(env('APP_URL'))

我已将会话的生命周期设置为 120 分钟,但我感觉我的用户在 120 分钟之前就退出了。

那是错字吗?他们的意思是 120 秒,即 2 分钟吗?

任何人都可以对此有所了解吗?

原文由 code-8 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 403
1 个回答

请将关闭时过期的 true 修改为 false:

 'expire_on_close' => false,

原文由 Anonymous Girl 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题