419 Page Expired PHP Origin: Application & API OSI layer 5 · Session Last updated 14 Oct 2026

Laravel: 419 Page Expired (CSRF token mismatch)

Laravel rejected a POST because the CSRF token was missing, expired or didn’t match the session.

Exact message you may see 419 Page ExpiredCSRF token mismatch
Seen on: PHP

Meaning

Every non-GET form must include @csrf. 419 also appears when the session expired, the session cookie isn’t sent (domain/HTTPS settings), or AJAX requests don’t include the X-CSRF-TOKEN header.

Common causes

  • Form missing @csrf
  • Session expired (long idle page)
  • Session cookie not stored (SESSION_DOMAIN / SECURE_COOKIE mismatch)
  • AJAX without the X-CSRF-TOKEN header
  • Load balancer with file sessions on multiple servers

⚡ Quick fix

  1. Add @csrf to forms
  2. Send the token in AJAX: meta tag + header
  3. Check SESSION_DOMAIN and SESSION_SECURE_COOKIE
  4. Use database/Redis sessions behind load balancers

Detailed fix by platform

JavaScript

  1. fetch(url, { method: 'POST', headers: { 'X-CSRF-TOKEN': document.querySelector('meta[name=csrf-token]').content } })

How to diagnose

  1. Token — Is _token in the request?
  2. Cookie — Is the session cookie sent back?
  3. Expiry — How long was the page open?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

403 — HTTP 403 Forbidden (HTTP)403422 Unprocessable Entity: The given data was invalid — Laravel: {"message":"The given data was invalid.","errors":{"email":["The email field is required."]}} (422) (Laravel)422 Unprocessable Ent…429 Too Many Requests (Laravel throttle) — Laravel: Illuminate\Http\Exceptions\ThrottleRequestsException: Too Many Attempts. / 429 Too Many Requests (Laravel)429 Too Many Requests…ActionController::InvalidAuthenticityToken — Rails: ActionController::InvalidAuthenticityToken (Can't verify CSRF token authenticity) (Ruby / Rails)ActionController::Inv…antiforgery token could not be decrypted — ASP.NET Core: The antiforgery token could not be decrypted / The required antiforgery cookie is not present (400 Bad Request) (.NET)antiforgery token cou…Attempt to read property "x" on null — Laravel/PHP 8: ErrorException: Attempt to read property "name" on null (Laravel)Attempt to read prope…Command "x" is not defined — Laravel: Symfony\Component\Console\Exception\CommandNotFoundException: Command "make:livewire" is not defined. Did you mean one of these? (Laravel)Command "x" is not de…Django CSRF — Forbidden (403) CSRF verification failed. Request aborted. (Python)Django CSRF419 Page …

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.