2

I have this form in asp MVC 3

<form action="/account/changeemail" id="form_changeemail" method="post">
    <%=Html.AntiForgeryToken()%>
    <input  type="email" name="email" id="email" class="required email" />
    <button class="green button" type="submit" id="changeemail">Change</button>
</form>

And this action

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult ChangeEmail(string email)
{

}

And on Safari on IOS this always gives me

A required anti-forgery token was not supplied or was invalid

This is the user agent of the browser

Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_3 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B511 Safari/9537.53

I've looked at the cookies, and the one for the request validation token is set to 1st of January 2001.

Any ideas? Thanks

Mihai
  • 2,740
  • 31
  • 45
  • Possible duplicate: http://stackoverflow.com/questions/14834036/a-required-anti-forgery-token-was-not-supplied-or-was-invalid-safari-only – Islam Yahiatene Feb 10 '14 at 15:45
  • I don't use windows authentication :) Any other ideas ? – Mihai Feb 11 '14 at 13:35
  • Found the problem: I was using jquery 1.4.2 on that page (for some unknown reason :D) and that was screwing it up – Mihai Feb 11 '14 at 15:15

1 Answers1

-3

This worked for me after selecting.

Go to Safari Settings >> Preferences... >> Privacy tab

  1. Click Remove all website data
  2. Select Block cookies as Never
parakmiakos
  • 2,994
  • 9
  • 29
  • 43
  • 2
    While this may work, it really does not address the real world situation as most user's do not disable this setting. Safari's conservative cookie policy does not allow cookie-creation from 3rd party domains until a user click is made. The first click, therefore, on form for instance, will always return said error. – Julian Dormon Oct 30 '15 at 18:40