asp.net mvc - "The anti-forgery token could not be decrypted" -
i running iis 8.5 on load-balanced (two-node) web farm. getting sporadic errors:
system.web.mvc.httpantiforgeryexception (0x80004005): anti-forgery token not decrypted....
i have tried/checked various solutions:
- at server-wide level, created explicit validation , decryption keys described here, , have synchronized them across both nodes. 1 thing note now, left "generate unique key each application" unchecked.
- the token generated once per page avoid problem described here.
but errors persist.
what can next troubleshoot?
edit:
controller code:
[httpget] public actionresult index() { var model = new loginmodel(); return view(model); }
relevant view code:
@using (html.beginform()) { @html.antiforgerytoken() @html.validationsummary(true) <h1>log in</h1> <fieldset> <label>email</label> @html.textboxfor(model => model.username) <label>password</label> @html.passwordfor(model => model.password) <input type="submit" /> </fieldset> }
i had same exact issue many people gave suggestions of changing machine key or might happen if have included anti forgery taken more once in form. issues didn't happen of reason, happened 1 simple stupid reason , it's improper div placement. mean if close div inside mvc form opened outside, issue.
Comments
Post a Comment