I'm trying to run my application on heroku, but for some requests (only POST, GET are working fine), I've got the following error on my Ajax POST request:
Error: Request failed with status code 419
When I check heroku logs, I get this error:
production.ERROR: file_put_contents(/app/storage/framework/sessions/r9yIHf3WlKIzROWGPlVOk59rwr6tVyAeCLuJ9wWx):
failed to open stream: No such file or directory
{"userId":1,"email":"xxx@gmail.com","exception":"[object] (ErrorException(code: 0):
file_put_contents(/app/storage/framework/sessions/r9yIHf3WlKIzROWGPlVOk59rwr6tVyAeCLuJ9wWx): failed to open stream: No such file or directory at /app/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122)
I've checked, the directory /storage/framework/sessions is existing.
I've tried to run chmod 777 -R / (but still this issue)
I've tried the following commands:
php artisan optimize
php artisan config:clear
php artisan cache:clear
php artisan config:cache
php artisan optimize:clear
A touch /app/storage/framework/sessions/r9yIHf3WlKIzROWGPlVOk59rwr6tVyAeCLuJ9wWx is not working either.
I've tried to remove the storage folder and create it again.
Do you have an idea of what could go wrong?