It was thought that the ASP. NET state server native supports multiple programs sharing session to set the same <sessionState/> and < for multiple applications deployed on the same server & under the same root domain name Machinekey/> things are done!
It turns out that TOO young TOO. Not work! at all.
Bing a big round, and then find a little Niang, see the following more valuable articles:
- Http://forums.asp.net/t/1759392.aspx?Share+sessions+between+asp+net+web+applications+using+State+Server
- Http://weblogs.asp.net/lichen/sharing-session-state-over-multiple-asp-net-applications-with-asp-net-state-server
- http://blog.itpub.net/12639172/viewspace-675757/
There are a few other early articles of Microsoft, can not be found back.
The conclusion of the synthesis is that when the session data is stored by the state server, it is open according to application domain, even if each program in the same root domain requests a cookie with the same session ID. Since each of these programs has a different application ID, the session's access is actually separated.
Under Search, Microsoft does not provide direct configurable options, nor does it provide public interface calls that can be modified. This is still very disappointing.
The method mentioned in the second and third article of the above reference is to use the. NET reflection mechanism to call Microsoft an undisclosed interface to modify the application ID of each program to make it unified when the program is initialized.
I tried the method of the override Global.asax.Init () and found it useless. (IIS version 7.5)
Debug with vs 2013 Breakpoints and find that Init is not called. Very disappointed.
Plus the front-end time found that the state server's memory has been slowly growing, from the initialization of the 50m, in rare cases, will slowly grow to more than 100m, the symptoms are very similar to the memory leak appearance.
OK, you are ruthless, do not want to Wade state server muddy water again.
The plan is to swap with memcached management session got.
Using ASP. NET state server to implement shared session state between multiple applications