Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Laraveldeep's avatar

Logging Out Twice End Up With Token Mismatch Error

Noticed this by accident today. I am using the out of the box make:auth.

1. login user (menu changes to logout).
2. duplicate this tab
3. from the new tab logout the user (menu changes to login). At this point user is logged out and it works fine but first tab is not aware of that.
4. from first tab try logging out

this causes error
TokenMismatchException in VerifyCsrfToken.php line 67:

This is quite unexpected.

How to prevent this?

Thanks!

0 likes
1 reply

Please or to participate in this conversation.