Developing Web Applications |
When used indiscriminately, the Session object is no more than a global data area. For large Web applications, the Session collection can become quite cluttered. This increases the likelihood that some part of the application might inadvertently make changes that have unexpected repercussions elsewhere. To avoid this situation, development teams must either use a naming convention that will decrease the chance of duplicate Session key names, or must use other methods of storing session values.
One such method uses the Dictionary object to further partition the global session namespace. Like the Session object, the Dictionary object can store any number of values and keywords in an associative array. Disparate sections of the application can create individual Dictionary objects as needed to contain local values, and can also store a single reference to their namespace in the Session object. Not only can groups of values be managed as a single entity, the Dictionary object makes it easy to free resources all at once when they are no longer required by the application. For more information about the Dictionary object, see the IIS 5.0 online product documentation.