I have an asp.net mvc 2 project with typical xss protection
<%=Html.AntiForgeryToken() %>inside each form and [ValidateAntiForgeryToken]for each Post action.
This works in both Chrome, Firefox, and IE.
But I get the following error in Safari (v 5.1.7).
System.Web.Mvc.HttpAntiForgeryException: The necessary anti-fake token was not specified or was invalid.
I see that the reason for the exception is that the cookie created RequestValidationTokenhas an invalid expiration date Mon, 01 Jan 2001, while in other browsers the value is correctly set Session.
How can I get Safari to stop setting a dummy expiration date for my Anti-Forgery cookie?
source
share