dimanche 27 décembre 2015

Laravel 5.2: Auth::logout() is not working

I'm building a very simple app in Laravel 5.2, but when using AuthController's action to log out, it just simply doesn't work. I have a nav bar which checks for Auth::check() and it doesn't change after calling the log out action.

I have this route inside the routes.php file:

Route::get('users/logout', 'Auth\AuthController@getLogout');

and it's outside the

Route::group(['middleware' => ['web']], function () statement.

I did also try to add the follow action at the end of the AuthController.php file.

public function getLogout() 
{
    $this->auth->logout();
    Session::flush();
    return redirect('/');
}

Do you have any ideas?

EDIT 1

If I clear Google's Chrome cache, it works.



via Chebli Mohamed

1 commentaire: