Search code examples
laravelhttp-redirecttokencentos7mismatch

Laravel 5.4 Token Mismatch Exception on live server


I am facing Token mismatch exception in Laravel 5.4 on live server. On my local machine running Windows XAMPP, the application works fine. When I deployed it to live machine running CENTOS 7 and LAMP stack, I see a redirecting to myhostname.com/login at the top left corner of the browser and then lands on an error page showing:

token mismatch exception on line 68 of VerifyCsrfToken.php.


Solution

  • I had this same problem and what i did was:

    First in your .env file remove: SESSION_DOMAIN And in set session driver like: SESSION_DRIVER=file (if your want it to save to a file)

    then do: php artisan cache:clear then `php artisan config:clear

    that worked for me.