为什么我在,即使关闭浏览器后,始终记录记得我设置为false [英] Why am I always logged in even after closing browser with remember me set to false
问题描述
我已经建立一个有效的用户/登录系统与laravel 4框架,一切工作正常。
I've creating a working user/login system with the laravel 4 framework and all is working well.
不过我总是登录到该网站,除非我跑退出的过程。
我会假设,如果我登录,关闭所有浏览器窗口,然后打开浏览器再次我会被注销。不是这种情况。
However I'm always logged into the site unless I run the logout process. I would assume that if I login, close all browser windows and open the browser again I would be logged out. This is not the case.
在我的验证::尝试我设置$记得false参数,即使它是默认为false。
In my Auth::attempt I am setting the $remember parameter to false even though it is false by default.
我不知道为什么会这样。如果我注销,关闭所有浏览器窗口然后再次打开他们我没有登录。所以这个工作正常。但是如果我登录,再次关闭我所有的浏览器,然后打开浏览器,我已经登录,甚至认为我已指定记得是假的。
I have no idea why this is happening. If I logout, close all my browser windows then open them again I am NOT logged in. So this works fine. But if I'm logged in, close all my browsers then open the browser again I am already logged in. Even thought I have specified remember to be false.
什么是让我登录?为什么总是记得我登录?我找不到这方面的消息。
What is keeping me logged in? Why does it always remember my login? I cannot find any information on this.
推荐答案
修改
'expire_on_close'=>假的,
到
'expire_on_close'=>真的,
在 /app/config/session.php
。
Laravel实际上没有记住你(你不会被再次验证您的 remember_token
),问题是,你的会话cookie仍然存在于浏览器关闭(因为它不是招'T过期),并Laravel认为你是一个登录的用户。
Laravel isn't actually remembering you (you're not being authenticated again by your remember_token
), problem is that you session cookie persists on browser close (since it hasn't expired) and Laravel sees you as a logged in user.
这篇关于为什么我在,即使关闭浏览器后,始终记录记得我设置为false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!