There are two types of configuration files: a machine configuration file and an application configuration file, both named config.web. The two are identical, except that the machine configuration file applies settings to all applications but the application configuration files are either restrictive or expansive on an application-by-application basis.
In Beta 1, the machine config.web file is in the WinNT\Microsoft.NET\Framework\v1.0.2204 directory, while the optional application configuration files exist in the application's directory. Application config.web files are optional in the sense that if an application config.web file doesn't exist, the machine config.web settings are used instead. ASP.NET session state settings can be made in the machine config.web file and overridden in a particular application's config.web file.
Note: Changes made to config.web are applied immediately, unlike classic ASP, where the server has to be stopped and started for settings to take affect.
Session configuration
Below is a sample config.web file used to configure the session state settings for an ASP.NET application:
configuration
sessionstate mode="inproc" cookieless="false" timeout="20" sqlconnectionstring="data source=127.0.0.1;user id=user id;password=password" server="127.0.0.1" port="42424" /
/configuration
Mode.
The mode setting supports three options: inproc, sqlserver, and stateserver. As stated earlier, ASP.NET supports two modes: in process and out of process. There are also two options for out-of-process state management: memory based (stateserver), and SQL Server based (sqlserver). We'll discuss implementing these options shortly.
Cookieless. The cookieless option for ASP.NET is configured with this simple Boolean setting.
Timeout. This option controls the length of time a session is considered valid. The session timeout is a sliding value; on each request the timeout period is set to the current time plus the timeout value
Sqlconnectionstring. The sqlconnectionstring identifies the database connection string that names the database used for mode sqlserver.
Server. In the out-of-process mode stateserver, it names the server that is running the required Windows NT service: ASPState.
Port. The port setting, which accompanies the server setting, identifies the port number that corresponds to the server setting for mode stateserver.
No comments:
Post a Comment