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

jonas1's avatar

Hi, How do I fix (1/1) TokenMismatchException

Each time I leave my session open and come back and try to sign in later, I get this token mismatch error. So I always have to clear laravel view catch to be able to access my account again.

What is a definite solution to this problem? How can i set laravel view cache to clear automatically every minute?

Any help will be appreciated

0 likes
2 replies
ftiersch's avatar

Do you reload before signing in again?

I think tokenMismatch is basically the CSRF token expiring so you need to create a new one. Or does it keep happening?

Snapey's avatar

After logging out, redirect to a page that does not have a form.

This could be your home page and login is a button that loads a new form.

If you leave your site on a form then when the session expires the csrf token is invalid.

Please or to participate in this conversation.