473,473 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ViewState error with Session Affinity and Web Farm on ISA Server

Hi Experts,

With Session Affinity and Web Server Farm on ISA Server 2006 accessing 2
backend IIS servers, I’m getting error “Validation of ViewState MAC failed.
If this application is hosted by a Web Farm or cluster, ensure that
<machineKeyconfiguration specifies the same validationKey and validation
algorithm. AutoGenerate cannot be used in a cluster”.

Here is the scenario when I got the error.

1. ASP.Net web application is installed on 2 backend IIS Servers. Web
application consists of a simple login page which contains UserName, Password
fields and Submit button.
2. Web farm is created on ISA Server 2006 to access both backend IIS Servers.
3. All the requests to the backend IIS servers go through the ISA 2006
firewall.
4. While creating Web Publishing Rule to access Web application folder from
backend IIS Servers, Session Affinity is used for Load Balancing so that the
requests from the same session should go to the same IIS server.
5. When I tried to access login page simultaneously from multiple browsers,
after submitting the form on web page simultaneously from different browsers,
it gave error “Validation of ViewState MAC failed” in some of the browsers.
6. I got the error only when I used HTTP protocol. When the same setup was
done for HTTPS, I did not get error and all the requests were routed to
different backend IIS Servers as expected.

I searched on net for help, in some of the resources, it is mentioned that
<machineKeyelement set in Web.config file is used for encrypting and
MAC-checking on the ViewState and if the encryption settings are different on
different servers, ASP.Net consider the ViewState as modified and gives the
exception. So, it is suggested to use the same <machineKeyon all the
backend servers in case of servers on Web farm. I tried using the same
<machineKeyon backend IIS Servers and the error was gone.

When we are using Session Affinity to create Web Publishing Rule which uses
Web Farm to handle both backend IIS Servers, why do we need same
<machineKey>? I want to understand the reason behind the error and why the
error occurs only on HTTP and not on HTTPS?

I would appreciate your quick response.

Thank you in advance.

Vijay
Jun 27 '08 #1
1 2718
It is possible that with https you have "sticky" load balancing - i.e.
it has to keep routing messages to the server that initiated the SSL
context, because only that server knows how to decrypt it. You can get
around this by using an NLB to tear down the SSL context before it is
divided between the app servers. Obviously if each connection is
sticking to a server, you don't get this problem, as the viewstate is
only seen by a single server.

So yes; you will need the same key on all servers in the farm.

Marc
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ersin Gentrk | last post by:
Server : WEB System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Web.HttpException: The View State is invalid for this page and might be...
3
by: Amit S. Jamgade | last post by:
Hi All, I am trying to share the session between classic ASP and ASP.Net application. For session sharing I used the method available on this link: http://msdn.microsoft.com/library/default.asp?...
2
by: Ben Rush | last post by:
Hello World, Okay, I have spent the day browsing the newsgroups and reading up on article after article concerning ViewState corruption and so forth, and I have a couple questions. We...
2
by: Bartosz Krzywicki | last post by:
I have a problem with the following error: "Server Error in '/sir' Application. -------------------------------------------------------------------------------- The viewstate is invalid for...
1
by: Kikoz | last post by:
Hi all. I override Page's SavePageStateToPersistenceMedium(...) and LoadPageStateFromPersistenceMedium() methods to keep page's ViewState on the server. Very well documented approach, nothing...
5
by: Dominic | last post by:
My question is about how to maintain view state in mobile ASP.NET across postback / request in a web farm environment. First of all, let's assume the web-farm does NOT use stick-session feature....
10
by: Lloyd Dupont | last post by:
When you define UserControl in source code the sample I see are often like that: ============ public string Text { get { String s = (String)ViewState; return ((s == null) ? String.Empty : s);...
5
by: russell.lane | last post by:
I'm getting the much-hated "validation of viewstate MAC failed" error. This is on an ASP.Net 2.0 app running in IIS with IE 6+ as the browser. The full error text is: Validation of viewstate...
3
by: Ken Shimizu | last post by:
I get an error when submitting an .ASPX page in Safari beta, MAC and PC document.getElementbyId(FolderBrowser).submit(); After the server side code has executed without problems I get the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.