Validation of viewstate MAC failed -View State Error

前端 未结 3 1201
粉色の甜心
粉色の甜心 2020-12-11 10:20

In my website, when a web page is idle for more than 5 minutes, then that page is not working until I refresh. The following error occurs:

Error: Sy

相关标签:
3条回答
  • 2020-12-11 10:54

    This sometimes happens if you are doing a postback from a form which has an action pointing to a different page.

    0 讨论(0)
  • 2020-12-11 10:59

    Make sure all the servers on the cluster are using the same encryption key.

    0 讨论(0)
  • 2020-12-11 11:03

    Although it's an old question, I will answer anyway because it might help someone else. So I had this problem in the past few days, and I realized that I started getting this error after I configured my cookies as HttpOnly and Require SSL:

      </system.web>
        <httpCookies httpOnlyCookies="true" requireSSL="true" />
      </system.web>
    

    Turns out that I just forgot to configure Visual Studio to open the SSL URL of my website. So as long as it opened the regular Url, the cookies couldn't be sent, and that what caused the error.

    In order to change the default Url, you simply need to figure out what is your SSL url: Click the project on solution explorer and press F4 (not Right Click -> Properties) and over there you'll see SLL URL under the the Development Server section. After that, go to the project properties page (Right Click -> Properties) and in the Web tab, put the SSL Url as the Project Url.

    0 讨论(0)
提交回复
热议问题