Symptoms
You receive the following error when logging into or submitting a form on a Laravel site.
419 | PAGE EXPIRED
Description
Laravel uses a Cross-Site Request Forgery (CSRF) protection mechanism to protect your site from external HTTP requests. This mechanism issues randomly generated, limited-duration tokens. The 419 error occurs when a request is sent to the server without this token.
Workaround
You should ensure that all forms have a hidden input named _token
with a value of csrf_token()
and that all AJAX requests have the X-CSRF-TOKEN
header.
Comments
0 comments
Article is closed for comments.