Knowledge Essentials - 3Essentials Hosting

Session timeout at 5 or 20 minutes or "Validation of viewstate MAC failed" error

Article ID: 504

 Back to Search

Symptoms:
You experience one of the following conditions on your ASP.net based site:

  • ASP or ASP.net: Application or Session values timeout after 5 minutes or 20 minutes
  • ASP.net generates error: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Resolution:

This is usually due to the application pool for your website closing... ASP.net stores information necessary to validate a user's session on the server and access their session/state variable within the application pool/worker process.  If there are no user connection activity for longer than the application pool idle timeout value, the application pool/worker process is shut down (to conserve resources) and that session information is purged.  On versions of Plesk before 8.2, the application pool idle timeout was set to 20 minutes, generally plenty of time for a user session.  However on Plesk 8.2, Parallels (the makers of Plesk) decided to implement a default of 5 minutes on the application pool idle timeout.  As a result, it's possible your user is on your site for longer than 5 minutes, and if they are the only person on the site (no other activity at that moment), then that idle timeout can trigger, shutting down the app pool, losing their viewstate/session information, and causing this error.

To address this, 3Essentials will gladly disable the Application Pool Idle Timeout value on your Application Pool for any customers whose plans include ASP.net at no additional charge.  Simply submit a support request asking for this to be disabled and specify your domain.  When you request this, we'll also disable the default "daily recycle" of the worker process (unless you specify otherwise).  This is a regular recycling of the application pool designed to recycle the application pool once every 27 hours to help keep the process healthy (mostly intended to clear memory usage by the process in event your code or a module within your code has a memory leak).  You can request we do not disable this, or that we set it to a different schedule - just specify your requirements in your support request.

For dedicated/virtual server customers, as always, we will set parameters to meet your needs.

You may also wish to read the following article on performance concerns for ASP.net sites (including DNN sites):


This error has ALSO been found to be generated by XIGLA Absolute News Manager .NET, CMS software, on systems after ASP.net SP 3.5 SP1 has been applied.  Specifically, this error is generated when trying to use the EDIT function to edit an existing article.  Xigla software has a fix for this, please contact Xigla.

 
Downloads Associated With This Article
No downloads are currently associated with this article.