TokenMismatchException in VerifyCsrfToken - Laravel 5.1

前端 未结 3 382
攒了一身酷
攒了一身酷 2021-01-02 17:05

I am building a REST API using Laravel 5.1 and I am getting this error:

TokenMismatchException in VerifyCsrfToken.php line 53:
3条回答
  •  醉酒成梦
    2021-01-02 17:31

    I was getting the same error, but with all the warnings about overriding CSRF validation, didn't want to change those settings.

    I eventually found that my Session Driver in /config/session.php was defaulting to memcached, and since I was on a development server I needed to override the SESSION_DRIVER env variable with 'file' to use the session in /storage/framework/sessions.

    /.env
    
    SESSION_DRIVER = file
    

提交回复
热议问题