0

Hello I have a login form that returns a 419-page expired error every time I submit it I already set the @csrf inside the form but nothing and also tried the csrf_filed inside the form and also but it in the header inside of meta tag but still not working, am working on a live server so I downloaded the files on my localhost and tried to submit the form again and everything worked fine on my localhost but on the server it still returns the error 419 pages expired, and also tried to submit the request to a function that just returns hello world but it also returns page expired i have nothing on my head I tried everything I know and nothing worked please I need help with this.

And thanks a lot

Sehdev
  • 5,486
  • 3
  • 11
  • 34
Awad Gorg
  • 5
  • 4
  • Try clearing your cache `php artisan cache:clear` – Sehdev Mar 22 '20 at 07:02
  • Does this answer your question? [Post request in Laravel - Error - 419 Sorry, your session has expired](https://stackoverflow.com/questions/52583886/post-request-in-laravel-error-419-sorry-your-session-has-expired) – nakov Mar 22 '20 at 07:06
  • no, I tried everything on that the session stored on a file and checked the storage access everything is fine as I said above the code is running on localhost fine but the problem on the version on the live server – Awad Gorg Mar 22 '20 at 07:21

1 Answers1

0

Sometimes cache cause this problem. Try below commands.

These will clear all cache and generate new token for your project.

php artisan key:generate
php artisan config:cache
php artisan cache:clear
php artisan view:clear
php artisan route:clear
Sehdev
  • 5,486
  • 3
  • 11
  • 34
  • didn't work I made a route that clears everything you wrote above but nothing happened the problem still exists. – Awad Gorg Mar 22 '20 at 07:34