0

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
Jelly Bean
  • 1,161
  • 1
  • 11
  • 22

2 Answers2

0

This is usually caused by the session not being able to store or due to old cookies being stored.

So make sure the proper permission is given to the storage directory where sessions are stored.

If you're using file-based sessions. The can be verified with

is_writable(config('session.files'))

You can follow the solutions provided in this other question raised, it is for Laravel 5.5 though.

"The page has expired due to inactivity" - Laravel 5.5

Anuj Shrestha
  • 966
  • 6
  • 18
0

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.

Jelly Bean
  • 1,161
  • 1
  • 11
  • 22