Search code examples
laravelservershared-hostingcsrf-protection

TokenMismatchException in Laravel App in Godaddy Server


I hosted my laravel (version 5.5) application in Godaddy server ,but Im getting error :

TokenMismatchException in VerifyCsrfToken.php (line 68)

when submitting ContactUs Form . Any one please help me .

in my config/session.php i set

'secure' => env('SESSION_SECURE_COOKIE', false),

and also given storage folder permission 777

but it is not working . anyone please help me to solve out.


Solution

  • I assume that you use csrf_token() in your forms,and we do not have to solve that.

    So make:

    chmod 777 storage/framework/sessions/

    Clear cache: php artisan config:cache

    Generate new app key: php artisan key:generate

    Good luck!