We will discuss the issue of ". Net session loss ....

Source: Internet
Author: User

After the website is uploaded to the server, the logon times out when users log on! Or no result is returned in the session detection ....

 

Set the session in the web. config file as follows:
<Sessionstate mode = 'stateserver 'stateconnectionstring = 'tcpip = 127.0.0.1' sqlconnectionstring = 'data source = 127.0.0.1; trusted_connection = Yes 'cookieless = 'true' timeout = '60'/>

At the same time, set "ASP. NET Status Service" in the service to auto-Enable. In this way, the session does not depend on a process.

Another method is to save the session to the sqlserver database.

Appendix:

By default, the session settings in the web. config file are as follows:
<Sessionstate mode = 'inc' stateconnectionstring = 'tcpip = 127.0.0.1 'sqlononstring = 'data source = 127.0.0.1; trusted_connection = Yes 'cookieless = 'true' timeout = '60'/>

The sessionstate tag has an attribute mode, which can be inproc, StateServer, or sqlserver (case sensitive ). The process is unstable. When some events occur, the process restarts, causing the loss of sessions stored in the process.

 

Related Article

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: info-contact@alibabacloud.com 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.