Suppose the user has opened two pages. In one of them, touches the logout button. Then on the other page, again, touch the logout button.
Which with error:
(1/1) TokenMismatchException
In VerifyCsrfToken.php (line 68)
At VerifyCsrfToken-> handle (object (Request), object (Closure)) in Pipeline.php (line 148) ......
. Do you have any solution?
in App\Exceptions\Handler.php Return the user to the form with a new valid CSRF token, so the page will refreshed and logout button will not exist.
public function render($request, Exception $exception)
{
if($exception instanceof TokenMismatchException)
{
return redirect()
->back()
->with('your msg');
}
return parent::render($request, $exception);
}
this looking like, page was refreshed.
Don't Replace POST with Get. It will not Safe And Standard.