Some situations when ASP. NET status services are used

Source: Internet
Author: User

In asp.net, the ASP. NET Status Service was used to save the session. It was no problem. Later I changed to a server, but I found that when the application pool is recycled, the session will be lost.

This is the case.

1. Enable the asp.net Status Service

2. Added in web. config

<SessionState
Mode = "StateServer"
StateConnectionString = "tcpip = 127.0.0.1: 42424"
SqlConnectionString = "data source = 127.0.0.1; Trusted_Connection = yes"
Cookieless = "false"
Timeout = "30"
/> Www.2cto.com

3. Add a separate windows user runuser to the iis_wpg group.

4. Set the application pool startup user to runuser.

5. The website's identity authentication is runuser


In this way, it is okay to save the session, but when the program pool is recycled, the session will be lost.

When the application pool startup user is restored to networkService, the session is normal after the collection.


Then I searched online and found something to add to web. config.

<MachineKey
ValidationKey = "cipher" decryptionKey = "5FC88DFC24EA123C" validation = "SHA1"/>

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.