title: ViewStateUserKey + shared hosting + ViewStateMac validation failure
body: <p>So, the question is simple, even though I'm starting to have doubts if this will get answered...</p>
  
  <p>I have a website, where I wanted to secure my viewstate with the recommended ViewStateUserKey..</p>
  
  <p>In my base page (inherited from Page obviously) I have this code:</p>
  
  <pre><code>    protected override void OnInit(EventArgs e)
      {
          base.OnInit(e);
  
          if (User.Identity.IsAuthenticated)
              base.ViewStateUserKey = Session.SessionID;
      }
  </code></pre>
  
  <p>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.</p>
  
  <p>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?</p>