Solved

asp.net Forms authentication expires before timeout with a error

Posted on 2010-09-05
4
697 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
Comment Utility
Hello Mr_Ezi

Do you have access to IIS at all?

Thanks,

Richard Hughes
0
 

Author Comment

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

Accepted Solution

by:
richard_hughes earned 500 total points
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now