Solved

asp.net Forms authentication expires before timeout with a error

Posted on 2010-09-05
4
703 Views
Last Modified: 2012-05-10
My application is hosted on a shared hosting plan so I don't have to much access to logs or settings, but if I'll be able to tell what cause's the problem I could ask the hosting company to fix it.

This is the error I get:

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

Source Error:

[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\admin\4abedb3d\bfad2684\App_Web_xmkh49pj.0.cs    Line: 0

Stack Trace:

[HttpException (0x80004005): Unable to validate data.]
   System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +289
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +140

[ViewStateException: Invalid viewstate.
      Client IP: 66.128.11.20
      Port: 12865
      User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.5; Avant Browser; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; WinNT-PAI 21.07.2009)
      ViewState: /wEPDwULLTE1MDYzMzkwMDQPZBYCZg9kFgICAw9kFgYCAQ9kFgZmDw8WAh4EVGV4dAUaRnJpZGF5LCBTZXB0ZW1iZXIgMDMsIDIwMTBkZAIBDxBkZBYBZmQCCg8PFgIfAAUoV2VsY29tZSA8Zm9udCBjb2xvcj0jOTkwMzAzPmFkbWluPC9mb250PmRkAgMPZBYCAgEPDxYCHgdWaXNpYmxlZ2RkAgUPZBYGAgEPZBYCAgEPDxYCHwAFEU9yZGVyIFN0YXR1czogTmV3ZGQCAw8PFgIfAWhkZAIFD2QWAmYPZBYEAgEPZBYCZg9kFgICAQ8WAh4LXyFJdGVtQ291bnQCAhYEZg9kFgJmDxUCEkluZGV4LmFzcHg/aWQ9aG9tZQRIb21lZAICD2QWAmYPFQImSW5kZXguYXNweD9pZD1vcmRlcnMmc3RhdHVzPU5ldyZzdGF0PTEGT3JkZXJzZAIDDzwrAAsBAA8WCh8CAggeCERhdGFLZXlzFggCu6MBAsejAQL3owECm6QBArOkAQLLpAEC16QBAuOkAR4JUGFnZUNvdW50AgIeFV8hRGF0YVNvdXJjZUl0ZW1Db3VudAISHhBDdXJyZW50UGFnZUluZGV4AgFkFgJmD2QWEAICD2QWDGYPZBYCZg8VAQUyMDkyM2QCAQ8PFgIfAAULUmVnaW5hIENoYW5kZAICD2QWAmYPFQEJOC8yOS8yMDEwZAIDD2QWAmYPFQEHJDg5Ni43OWQCBA9kFgJmDw8WAh4LTmF2aWdhdGVVcmwFFWphdmFzY3JpcH...]

[HttpException (0x80004005): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106
   System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +242
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
   System.Web.UI.HiddenFieldPageStatePersister.Load() +207
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105
   System.Web.UI.Page.LoadAllState() +43
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.index_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\admin\4abedb3d\bfad2684\App_Web_xmkh49pj.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
0
Comment
Question by:Mr_Ezi
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:richard_hughes
ID: 33607096
Hello Mr_Ezi

Do you have access to IIS at all?

Thanks,

Richard Hughes
0
 

Author Comment

by:Mr_Ezi
ID: 33607098
No I don't have access to the iis settings.
0
 
LVL 9

Accepted Solution

by:
richard_hughes earned 500 total points
ID: 33607105
Hello

Have a look here:

http://forums.asp.net/t/1166634.aspx

You may need to find out what your hosted machine key is from the hosting company if you can.

Thanks
0
 

Author Closing Comment

by:Mr_Ezi
ID: 33823404
I don't need to know the machine key from the company, there are online key generetors out there that did the job just fine.

Thanks
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question