Laravel: the CSRF token is missing or invalid, usually because the session expired.
Laravel returns 419 "Page Expired" when its VerifyCsrfToken middleware rejects a POST, PUT, PATCH or DELETE: the request had no CSRF token, or the token does not match the one in the user's session. Most often the session expired while a form was open, or the session cookie was never stored.
@csrf Blade directive.X-CSRF-TOKEN (or X-XSRF-TOKEN) header.SESSION_LIFETIME) while the page was open.SESSION_DOMAIN, SESSION_SECURE_COOKIE=true over plain HTTP, or a full/unwritable session store.@csrf to forms and send the token from <meta name="csrf-token"> in JS requests.SESSION_DOMAIN, SESSION_SECURE_COOKIE and the session driver; behind a proxy, configure TrustProxies so HTTPS is detected.| Header | Role |
|---|---|
X-CSRF-TOKEN | Header Laravel reads the token from on AJAX requests. |
Set-Cookie | XSRF-TOKEN and the session cookie. |
HTTP/1.1 419 unknown status
Content-Type: text/html; charset=UTF-8
<title>Page Expired</title>