【发布时间】:2016-03-21 10:08:59
【问题描述】:
我在退出 laravel 5.1 应用程序时遇到问题 - 我认为问题在于会话没有被破坏。
我的问题几乎与以下内容相同:
Laravel 5 Auth Logout not destroying session
需要注意的是我的解决方案是使用
session_unset();
而不是
Session::flush();
所以我退出 laravel 5.1 应用程序的有效解决方案是:
public function getLogout()
{
\Auth::logout();
session_unset();
return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
//these attempts will not remove values from the session.....
//session()->forget('db');
//\Session::flush();
}
任何想法为什么 \Session::flush(); 和 session()->forget('db'); 不起作用?
【问题讨论】: