Laravel 5.8.11 Getting 419 Page Expired All Forms Affected

- 1 answer

Started with Laravel 5.5 upgraded to 5.8 (current version 5.8.11). The problem is that when I test locally everything works as it should, when I upload my project to my hosting (dedicated server / shared hosting tried on both) I get a 419 page expired but this is not unique to login all forms are affected and give 419 page expired.

5.5 -> 5.6

update dependency: "fideloper/proxy": "^4.0", updated all other dependencies to latest versions
update php unit: 7
removed php artisan optimize from composer.json

5.6 -> 5.6.30 no changes

5.6 -> 5.7 update laravel/framework dependency to 5.7 in composer.json changed assets dir

From resources/assets/js/* to resources/js/*
From resources/assets/sass/* to resources/sass/*

update mix.js

mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');

5.7 -> 5.8 Update laravel/framework dependency to 5.8 in composer.json

Created fresh 5.8 installation and moved files to it, currently moving only the files I have edited for created (making 2 versions 5.5 and 5.8) but this will take some time.

Generated new app key (no change) Set default session domain to my domain (no change) Tested on Firefox and chrome + incognito mode to see if cached session are a problem

Ran following commands:

composer dump-autolaod
php artisan cache:clear
php artisan config:cache
php artisan route:cache

All forms have csrf_field(), also present in head

What might be causing this issue?



So what worked for me was creating a new laravel 5.8 installation and copied its files into my existing project and skip any files it wants to overwrite, run composer update and done. so i assume somewhere i was missing a file.

It may not be the best solution but this worked for me.