|
|
"Dig within. Within is the wellspring of Good; and it is always ready to bubble up, if you just dig."
|
|
--
Marcus Aurelius
|
|
The StructureTooBig StateManager is an HTTP Module for
managing session state in ASP.NET. Out of the box, ASP.NET
offers three ways to handle session state: InProc, a State Server (which is a
Windows Service), and in SQL Server (using your existing SQL Server
infrastructure). All three offer various advantages and disadvantages -- please
read the comparison page to see
a breakdown of both the built in mechanisms for handling state, but also the
StructureTooBig StateManager.
No single product is the right solution for all situations. Who should use the
StructureTooBig StateManager? The following are a few scenarios where the
StateManager may be a good choice:
-
Your website is hosted on a shared hosting platform
and you have no control over application recycles, IIS resets, reboots, etc.
State Server is often not available under shared hosting plans, and SQL Server
(if available) may be possible, but in a shared environment the performance is
typically horrific for this kind of volume.
-
You have a large, geographically load balanced site
and the performance and/or reliability of using SQL Server or a State Server is
degrading the user experience.
-
You have a large, load balanced site
and have no state management system at all (!) ... perhaps relying on sticky
server assignments or unencrypted cookies.
-
You have a site of any size with no time or budget
to implement the necessary hardware to support state management.
-
You want greater control
over session management -- such as session timeout (which can effectively be
infinite), strongly typed objects and intellisense support, and the ability to
rehydrate session data automatically with persisted values that you want
maintained past the session lifespan.
-
You already have a state mechanism but want a way to easily
encrypt persisted cookie values, and easily rehydrate objects when the user
returns.
You bet! An HTTP module is an object that hooks into the HTTP pipeline to
perform various tasks. In some cases, these may be passive to the rest of the
application, such as logging a request. They may handle authentication, or in
this case, the StateManager handles acquiring and saving state. Other modules
or page handlers (like an ASPX page) can then use this information. The three
built in state management types are also implemented through an HTTP
module.
Integrating this module is really easy. By adding a tiny bit of data to the
web.config, the module will begin working and at this point is still completely
transparent. In fact, you can still use the old session state and begin
migrating over time, or simply use the StructureTooBig StateManager on a few
pages for testing.
|
|