when logout from dashboard has logout successfully but click back button then enter dashboard,
- logout from dashboard
- then browser back button click
- and enter dashboard without email and password
- then turn click logout show error page expired 419
when logout from dashboard has logout successfully but click back button then enter dashboard,
The same happens when the user's session expires (they have been gone a while) and then tries to logout.
You can prevent this by excluding the csrf token when the (now) guest user tries to logout.
I wrote it up here https://talltips.novate.co.uk/laravel/csrf-and-expired-logout-forms
A solution to the problem is relatively simple, and requires a small addition to the VerifyCsrfToken middleware;
use Closure;
//
public function handle($request, Closure $next)
{
if(!Auth::check() && $request->route()->named('logout')) {
$this->except[] = route('logout');
}
return parent::handle($request, $next);
}