Configuring the session in Webconfig

Source: Internet
Author: User

2 , configuring the session in Web. config
Session configuration information in the Web. config file:

Copy the Code code as follows:

<sessionstate mode= "off| inproc| stateserver| SQL Server "
Cookieless= "True|false"
timeout= "Number of minutes"
Stateconnectionstring= "Tcpip=server:port"
sqlconnectionstring= "SQL connection string"
statenetworktimeout= "Number of seconds"

mode sets where to store the session information:
-off is set to not use session function;
-inproc is set to store the session in the process, that is, the ASP storage mode, which is the default value;
The-stateserver is set to store the session in a separate state service;
The-sqlserver setting stores the session in SQL Server.
cookieless sets where the client's session information is stored:
-ture uses the cookieless mode, when the client's session information is no longer stored using a cookie, but instead is stored via a URL. For example, the URL is http://localhost/MyTestApplication/(ulqsek45heu3ic2a5zgdl245)/default.aspx
-false uses cookie mode, which is the default value.

Timeout sets the number of minutes after which the server automatically discards session information. The default is 20 minutes.

stateConnectionString sets the server name and port number used when the session information is stored in the State service, for example: "tcpip=". When the value of mode is StateServer Yes, this property is required. (42424 is the default port).

sqlConnectionString sets the connection string when connecting to SQL Server. For example "datasource=localhost;integrated security=sspi;initial catalog=northwind". This property is required when the value of mode is SQL Server.

stateNetworkTimeout settings when the session state is stored using StateServer mode, the TCP/IP connection to the server that stores the state information is disconnected after the number of seconds that the Web server is idle. The default value is 10 seconds.

Configuring the session in Webconfig

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.