Quantcast
Channel: PlanetDomain Support » Web Hosting
Viewing all articles
Browse latest Browse all 10

Creating a Machine Key for ASP.NET applications

$
0
0

Customers utilising the ASP.NET hosting infrastructure can increase performance of their application by setting a unique MachineKey in their web.config configuration file.

This MachineKey assists in validating session data, which is the most popular application of the MachineKey on our cloud network.

Generate a unique MachineKey

To create a MachineKey for your application, simply visit the vendor’s website http://aspnetresources.com/tools/machineKey

The tool creates a 256-bit decryption key and a 512-bit validation key, with Rijndael as the data validation algorithm.

Once the keys are generated, they are converted into a string of hexadecimal characters.

Use the MachineKey in your application

To apply it to your application, simply copy the code into your web.config file, then re-upload it to the server. If you are creating the MachineKey to fix your session handling, see below for an example of what your <system.web> web.config directives code should appear as.

Note, the values shown for validationKey and descriptionKey are examples only and will not work on a live website:

<system.web>

<machineKey
validationKey="1234567890123456789012345678901234567890AAAAAAAAAA"
decryptionKey="123456789012345678901234567890123456789012345678"
validation="SHA1" decryption="Auto" />

<sessionState  mode="StateServer"
stateConnectionString="tcpip=asp-ss.netregistry.net:42424"
stateNetworkTimeout="10" timeout="20" />

</system.web>

Viewing all articles
Browse latest Browse all 10

Trending Articles