Laravel在浏览器关闭期届满会话不在Chrome中工作 [英] Laravel expire session on browser close not working in Chrome

查看:268
本文介绍了Laravel在浏览器关闭期届满会话不在Chrome中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel Framework 4.1.21版,并且在浏览器关闭时,expire_on_close选项不会在Chrome中结束会话。我的config / session.php文件中的选项如下所示:

 'driver'=> 'file',
'lifetime'=> 120,
'expire_on_close'=> true,

同样在开发人员工具栏的资源> Cookies中,Expires值设置为Session 为laravel_session cookie。

这虽然在Firefox中正常工作。任何想法我错过了什么?感谢!

解决方案

这是Chrome功能的原因。当您关闭Google Chrome时,它实际上会在后台运行(如评论中所述)。



以下是详细信息: https://code.google.com/p/chromium/issues/detail?id=128513


I am using Laravel Framework version 4.1.21 and the "expire_on_close" option does not end the session in Chrome when the browser is closed. The options in my config/session.php file look like this:

'driver' => 'file',
'lifetime' => 120,
'expire_on_close' => true,

Also in the developer toolbar, under Resources > Cookies, the Expires value is set to "Session" for the laravel_session cookie.

This works fine in Firefox though. Any ideas what am I missing ? Thanks !

解决方案

It's becasue of Chrome's feature. When you close Google Chrome, it actually runs on background (as mentioned on comments).

Here's detailed information: https://code.google.com/p/chromium/issues/detail?id=128513

这篇关于Laravel在浏览器关闭期届满会话不在Chrome中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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