right after Session::flush(); put a redirect to the login page or whatever page you want that doesn't require being logged in. Now if you login again, all should work.
Can't get Authentication to Work For me.
Using Laravel 5.1 And 'Out of the Box' authentication
I have discovered that my application is not logging out a user when I click "logout" ie I can go back into a protected page. I have doubled checked that my controllers are using
$this->middleware('auth');
So, looking into:
public function getLogout(){
return view('auth/login');
}
I notice that it has no way of flushing the session. So I add,
Auth::logout();
Session::flush();
It will then work correctly until I change the login name, then if I do I get the error:
TokenMismatchException in VerifyCsrfToken.php line 53:
I have checked that my login page does contain the value:
{!! csrf_field() !!}
And I can see it in the view source
I have googled and checked the docs many times. But can not figure out what is going here.
Any advice would be SUPER welcome.
Many Thanks !!
Please or to participate in this conversation.