Ahmed Mohamed
Ahmed Mohamed

Reputation: 23

Laravel 419 session expire after deployment to shared host

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

Upvotes: 1

Views: 2871

Answers (2)

Teoman Tıngır
Teoman Tıngır

Reputation: 2891

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

Upvotes: 1

N69S
N69S

Reputation: 17206

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

Upvotes: 1

Related Questions