php - in laravel When run Logout route twice consecutively , i get csrf token mismatch error -
suppose user has opened 2 pages. in 1 of them, touches logout button. on other page, again, touch logout button.
which error:
(1/1) tokenmismatchexception in verifycsrftoken.php (line 68) @ verifycsrftoken-> handle (object (request), object (closure)) in pipeline.php (line 148) ......
. have solution?
in app\exceptions\handler.php return user form new valid csrf token, page refreshed , logout button 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 refreshed.
don't replace post get. not safe , standard.
Comments
Post a Comment