So, the question is simple, even though I'm starting to have doubts if this will get answered...
I have a website, where I wanted to secure my viewstate with the recommended ViewStateUserKey..
In my base page (inherited from Page obviously) I have this code:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (User.Identity.IsAuthenticated)
base.ViewStateUserKey = Session.SessionID;
}
Works good on localhost, however, when I upload it to hosting (shared hosting provided by one of our local providers), it gives the traditional "Validation of viewstate MAC failed" error after I authenticate. If I comment this code out, it works perfectly, so I'm 1000% sure this is the cause.
What's the best approach to perform viewstate security on the shared hosting? I have already set ViewStateMac="Enabled" as well. Is it enough or what is the recommended workaround?