Support the ongoing development of Laravel.io →
posted 9 years ago
Configuration
Last updated 2 years ago.
0

That's the indented behavior. The Token mentioned in the exception is the CSRF token in the login form (and other Laravel forms) which is there to prevent cross-site request forgery (thus the name). The token is good for about two hours, if you submit a form after that you get the exception.

If you want to handle this situation some other way, you can write your own error handler, and, say, just redirect back to login form.

It's also possible, but not advisable, to turn off CSRF protection altogether. It can be done by removing VerifyCsrfToken middleware in app/Http/Kernel.php file.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

extjac extjac Joined 14 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.