简体   繁体   中英

Laravel missing CSRF token via Ajax call and AWS load balancer

Since I moved a Laravel 5.4 project to AWS, most of the Ajax request is throwing an error TokenMismatchException in VerifyCsrfToken.php line 68 . I don't know what else I can do to fix it. Another info that could be important is that I am using a load balancer between 2 servers.

In all request, I send the X-CSRF-TOKEN on the header and the _token at the form data.

Sometimes the request works but sometimes don't.

Thanks

如上面@ Michael-sqlbot所述,通过启用粘性来解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM