RequestVerificationToken does not match

后端 未结 3 1402
攒了一身酷
攒了一身酷 2020-12-04 12:48

I have a problem with the anti CRSF MVC mechanism. The cookie and the form input returned does not match. I\'m getting an error every single time, only in one specific page.

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 13:30

    If this is being sent as an Ajax request, then the current setup of the framework isn't build to do this naturally.

    Luckly Phil Haak wrote a nice blog post on dealing with CSRF and Ajax -> Preventing CSRF With Ajax which goes into some good detail about how to use the existing framework and modify it to work for Ajax/Json.

提交回复
热议问题