b.Server Session State Pattern

  1. Motivation

    1. Stores data in globally shared object or persistant storage on server that can be shared across different sessions.

  2. Summary

      1. Server Session State is easy to implement with the built-in session state capability.

      2. The great appeal of Server Session State is its simplicity. In a number of cases you don't have to do any programming at all to make this work. Whether you can get away with that depends on if you can get away with the in-memory implementation and, if not, how much help your application server platform gives you.

      3. By default .NET stores session data in the server process itself. You can also adjust the storage using a state service, which can reside on the local machine or on any other machine on the network.

      4. With a separate state service you can reset the Web server and still retain the session state. You make the change between in-process state and a state service in the configuration file, so you don't have to change the application.

  3. When to Use

      1. When you have to shared some data either across different session or different calls of same sessions.

  1. Specific Considerations

      1. Clustering and Failover :Where the programming effort comes into play is in session maintenance, particularly if you have to roll your own support to enable clustering and failover. It may work out to be more trouble than your other options, especially if you don't have much session data to deal with or if your session data is easily converted to tabular form.

  1. References