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"/>