简体   繁体   中英

Laravel v8.x - Jetstream Inertia, 419 page expired on production

enter image description here

page expired 419 appears when in production. I've tried to run php artisan clear:cache , php artisan config:cache , php artisan key:generate , and also change the SESSION_DOMAIN with the same domain, but the page still error

if I deactivate the CSRF middleware it doesn't have an error, but I can't go to the next page.

I can run it on local, but when I use production database in local have the same error page.

i fixed it by removing this meta from the main blade.php template.

<meta name="csrf-token" content="{{ csrf_token() }}">

because of this warning on inertiajs page:

If you're using Laravel, be sure to omit the csrf-token meta tag from your project, as this will prevent the CSRF token from refreshing properly.

I think it is possible there are two or more issues with the 419 PAGE EXPIRED.

I was never able to get it to work by changing the CRSF token, removing it, or disabling it.

I think the actual cause has to do with permissions with where the SESSION_DRIVER data is stored.

By default the.env has SESSION_DRIVER=database. Changing database storage to file storage SESSION_DRIVER=file works if your file permissions are correct. Once you have the file permissions set correctly, change back to SESSION_DRIVER=database if you so desire.

I was using SQLite3, and the only way it worked was if the database was in location ~/laravel/stoarage/sqlite3.database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM