The required anti-forgery cookie “__RequestVerificationToken” is not present

前端 未结 8 1220
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 03:31

My website is raising this exception around 20 times a day, usually the form works fine but there are instances where this issue occur and I don\'t know why is so random.

<
相关标签:
8条回答
  • 2021-02-01 04:01

    put the @Html.AntiForgeryToken() inside your form

    0 讨论(0)
  • 2021-02-01 04:02

    Might want to take a look at this question. The anti-forgery cookie token and form field token do not match in MVC 4

    It is possible that this is a timeout issue. Basically when the timeout happens the cookie is not stored because the iis user that the site is running under does not have the proper access. For me I changed the application pool to load the user profile and this seemed to fix it.

    0 讨论(0)
提交回复
热议问题