Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You are here: Home / Microsoft / How-To Configure Session State in a Windows Web Farm.

How-To Configure Session State in a Windows Web Farm.

May 16, 2006 by Rob Bazinet

Tweet

I recently had the opportunity to configure our new web servers running Microsoft Windows 2003 Server and IIS 6.0. These servers are to be used in our development and production environments and will use Microsoft's Network Load Balancing to handle server load. This configuration allows an administrator to take an individual server off line for maintenance or add an additional server without interrupting service to our clients. We are running ASP.NET 2.0 and one of the features we are taking advantage of is running a State Server in a seperate machine. In order for a web farm to manange session state between web requests a few things need to be done in order for the user to have the same session between these requests. The problem lies in the fact that in a web farm the user is not guaranteed to come back to the same server between requests and session must be maintained. The detail which I find poorly documented is a machineKey needs to be added to each member of the web farm needing to share session. These keys MUST be the same on all servers in the web farm. As you can see below the key is a very large hex number, but don't worry you won't have to make it up. The section below is put in the machine.config on each server this will take care of the problem. This key could just as well been put into the web.config but I chose the machine.config file so when we add applications to our web farm I won't have to mantain multiple web.config files with this information in it. <machineKey validationKey='8ED2CDBA742675EB1EDB2C650245CD179998786C2F74D2EF56BE488519BAE 55B26717CF76A5348DC83D34F3E3F079DECAD2075FF278BD927C06F784923F59DD1' decryptionKey='B134B1E055D415013E31DECBF84B80492E8A8F1623F7332E' validation='SHA1'/> A great online utility to generate the key for you and give you the section for the .config file is available here. Technorati Tags : ASP.NET, Visual Studio 2005, Microsoft

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Related

Filed Under: Microsoft

Care about your privacy? I do and use Fathom Analytics on this site.

Fathom Analytics

Recent Posts

  • Social Media Times Are Changing
  • It has certainly been a long time…
  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Everything I read these days mentions ChatGPT or AI as the answer to everything. So many red flags. I hate trends l… https://t.co/ITLxsfAvd9
    about 1 week ago
  • If anyone knows any projects looking for some dev help, mainly Rails, as a lead who can manage small teams…I’d love… https://t.co/u0ClZ8x5wB
    about 3 weeks ago
  • This is such the truth…Even Amazon can't make sense of serverless or microservices https://t.co/0zK9YVMdrj
    about 4 weeks ago
  • I’m not sure I’d subscribe to content on Twitter when I already follow someone. Maybe I’m missing something.
    about 1 month ago
  • This looks really cool and a great real world use of AI. https://t.co/DzX5BbgDdY
    about 1 month ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon