I am having problems exiting the laravel 5.1 application - I believe that the problem is that the session is not destroyed.
My question is almost identical:
Laravel 5 Auth Logout does not destroy the session
with the caveat that my decision is to use
session_unset();
but not
Session::flush();
so my working solution to exit the laravel 5.1 application:
public function getLogout()
{
\Auth::logout();
session_unset();
return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
}
Any ideas why \Session::flush();and session()->forget('db');do not work?
source
share