views:

85

answers:

2

I'm trying to implement a SessionState server to allow multiple web servers to share the same state. At first this will be the different dev machines, and later it'll be the different web servers in the web farm.

So far, I'm making good progress I think, but one of the requirements has me confused. In order to implement this, I need to make sure that all web servers are using the same machine key.

This is a sample MachineKey taken from my local dev machine:

<section name="machineKey" 
 type="System.Web.Configuration.MachineKeySection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
 allowDefinition="MachineToApplication"/>

If we have a Session State Server deployed locally, do I need to ensure that all other machines using this service (specifically, the other devs working on the same project, and then when we deploy to the web farm) have the exact same entry in their Machine.Config files?

Or do I have to somehow generate a new machine key that can apply to all the machines?

A: 

The MachineKey is the key, the session gets encrypted to the user.

That means, they are only useful on the Webservers. as they are encrypting it to the client requests. i think the SessionState machine key is not important at all (but i didnt find now the documentation stating that...)

cRichter
I'm not sure I understand. If 3 devs are all using the same machine key - basically the same string I've specified above, shouldn't they all be able to use the same session state server, when running their applicatons on their local IIS?
DaveDev
a machine key entry looks like this'<system.web><machineKey validationKey="<ValidationKey>" decryptionKey="<decryptionKey>" decryption="3DES" validation="SHA1" /></system.web>' that should be placed in your web.config. and its only used for talking through the client's machine. All your dev and server machines should have the same (at least in the same environment,.. test, live, etc)
cRichter
A: 

I ended up using this:

http://www.developmentnow.com/articles/machinekey_generator.aspx

DaveDev