Troubleshooting anti-forgery token problems

前端 未结 11 2073
孤城傲影
孤城傲影 2020-11-27 03:48

I have a form post that consistently gives me an anti-forgery token error.

Here is my form:

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
         


        
11条回答
  •  遥遥无期
    2020-11-27 04:22

    Are you on one server or a web farm? If a single server, comment out your machineKey element in your web.config and try again as a base starting point. Any change? Also - can you think of any reasons your cookies would be getting cleared or expiring - they are required for this to work properly as well.

提交回复
热议问题