Why does @Html.AntiForgeryToken() generate different tokens in same response?
问题 A single Razor view contains several forms, each with its own call to @Html.AntiForgeryToken() <form id="f1"> @Html.AntiForgeryToken() </form> <form id="f2"> @Html.AntiForgeryToken() </form> As I understand it, both of these anti forgery tokens should be the same. <form id="f1"> <input name="__RequestVerificationToken" type="hidden" value="duVT4VtiYybun-61lnSY1ol__qBwawnELooyqT5OSrCJrvcHvDs_Nr9GLxNxwvBaI4hUcKZVkm6mDEmH2UqNorHD1FnJbKJQLWe8Su_dhy_nnGGl5GhqqC3yRGzcxbBM0" /> </form> <form id="f2"