© 2004 Microsoft Corporation. All rights reserved.

Figure 2 Session Attributes

Attribute
Description
mode
Specifies where to store the session state
Inproc
Stored locally in memory. This is the default
StateServer
Stored in the memory of a remote server
SqlServer
Stored on a SQL Server database
Off
Session state is disabled
cookieless
Specifies whether client sessions should be identified without using cookies. Can be true or false. The default is false
timeout
Specifies the number of minutes a session can be idle before it is abandoned. The default is 20
connectionstring
Specifies the server name and port where session state is stored remotely. Takes the form "server:port". The attribute is required when mode is set to "StateServer"
sqlconnectionstring
Specifies the connection string for a SQL Server database. The attribute is required when mode is set to "SqlServer"

Figure 4 Techniques for Managing State

Technique
Recommended with
Not Recommended with
Persisting to the Session object
Web farm
Single server, large data sets
Persisting to the Application or the Cache object
Relatively constant data, single server
Web farm
Persisting to local files
Single server, large data sets to retrieve on demand
Web farm
No cache on the Web server
Acceptable speed in relation to the data set size
Large data sets to process all at once