0

I am using php artisan serve in this Laravel 8 project and after setting the SESSION_DOMAIN value in my .env file, all form post requests come back with 419 session expired.

The session domain is set to SESSION_DOMAIN=".localhost:8000" and I have hard-refreshed (ctrl+f5) in addition to clearing browser cookies for localhost.

Tests still pass and if I remove SESSION_DOMAIN from my .env file, I can register/login with no problems.

Any assistance would be appreciated! :)

Infinity
  • 13
  • 3
  • Sometimes it's just that browsers, mainly Chrome won't put the Set-Cookie session value because it's malformed or non-standard. So Laravel won't find any existing session value from the HTTP request to compare to the received _token value from the FORM. Avoid using SESSION_DOMAIN=... with IP which Chrome and HTTP Cookie Specs consider as insecure. this comment I found here https://stackoverflow.com/questions/52583886/post-request-in-laravel-error-419-sorry-your-session-419-your-page-has-exp hope its useful – omar esmaeel Oct 20 '21 at 18:45

0 Answers0