Using ASP. NET state server to implement shared session state between multiple applications

Source: Internet
Author: User

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:

    1. Http://forums.asp.net/t/1759392.aspx?Share+sessions+between+asp+net+web+applications+using+State+Server
    2. Http://weblogs.asp.net/lichen/sharing-session-state-over-multiple-asp-net-applications-with-asp-net-state-server
    3. 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

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.