问题
As I mentioned in my post in my Laravel 4.1 application I have the "Remember me" option.
When I connect in chrome with "Remember me" checked and close the browser and open it, it's working, even when I don't check it!
But with Firefox it work perfectly. When I check "Remember me", close then open the browser I'm still connected.
When I don't check it and connect, close then open the browser it return me to the login form with error message.
I don't understand why it's not working in chrome.
else if (Auth::attempt($credentials, $remember)) {
return Redirect::intended('/');
}
回答1:
It's because, probably Chrome is still running in the background after you've closed the browser. Try to disable Continue running background apps when Google Chrome is closed feature, follow these steps:
- Open
chrome://settings - Click
Show advanced settings - Go to to System section (downward) and disable
Continue running background apps when Google Chrome is closed. This will force theChromebrowser to close completely and then it'll delete the session cookies as well.
This is a common problem using Chrome and I've faced it before and solved it right this way.
来源:https://stackoverflow.com/questions/25627194/laravel-remember-me-not-working-in-chrome-work-in-firefox