C # Asp.net IIS set the session expiration time in Web. config and IIS

Source: Internet
Author: User

Sometimes in the web. config sets the sessionstate or sets the session in the class file. timeout: During access to IIS, it times out every time it fails to reach the time. The reason is that the session timeout is set in IIS, and the session method in IIS is:
In IIS, right-click the default website-> main directory-> ApplicationProgramSet the point in configuration-> options-> enable session Status-> set the time for Session Timeout

Set the session expiration time in Web. config:

<System. Web>

<Sessionstate mode ="Inproc"Timeout ="60"/>

</System. Web>

Settings in the aspx file:

Session. Timeout = 60;

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.