我在 Laravel 5.2 中构建了一个非常简单的应用程序,但是当使用AuthController
's 操作注销时,它根本不起作用。我有一个导航栏,用于检查Auth::check()
并且在调用注销操作后它不会改变。
我在 routes.php 文件中有这条路线:
Route::get('users/logout', 'Auth\AuthController@getLogout');
它在外面
Route::group(['middleware' => ['web']], function ()
陈述。
我也尝试在 AuthController.php 文件的末尾添加以下操作。
public function getLogout()
{
$this->auth->logout();
Session::flush();
return redirect('/');
}
你有什么想法?
编辑 1
如果我清除 Google 的 Chrome 缓存,它就可以工作。