1

I develop multi auth laravel 5.7 application and i works fine in my local env but after deploying it to shared host server and try to login or activate any post request with CSRF token the server return 419 session expire please refresh the page. if i disallow laravel csrf middle-ware it works fine, right now i'm really confused and need any help about this situation or the any information about why laravel will return this error

3
  • Did you check your session configuration?
    – jakub_jo
    Oct 10, 2018 at 9:51
  • can you explain more.. Oct 10, 2018 at 9:52
  • Apparently your sessions do not persist, you need to review your session configuration. Do you store the sessions in files? Is the directory writeable?
    – jakub_jo
    Oct 10, 2018 at 9:54

2 Answers 2

1

You have to define application key (APP_KEY) before to use laravel application. so run below command for creating new application key

php artisan key:generate

This will generate a key and put it in your env file.

After that delete your config cache and try again

php artisan config:cache
1

you're missing the APP_KEY= in the .env file

2
  • i use the same env file from my local environment with the app key and change the database configs but still get the same response. Oct 10, 2018 at 9:50
  • have you checked your SESSION_DRIVER= in the .env file ? is there no error in storage/logs/laravel.log file
    – N69S
    Oct 10, 2018 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.