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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -