Sharing sessions across applications using the ASP.NET Session State Service

后端 未结 3 1660
深忆病人
深忆病人 2020-11-22 12:05

I am trying to share sessions between two web applications, both hosted on the same server. One is a .net 2.0 web forms application the other is as .net 3.5 MVC2 application

3条回答
  •  攒了一身酷
    2020-11-22 12:46

    You can use a common Machine key to generate same Session ID inside both applications for a given user. Additionally, you should also plan on storing sessions of both applications in a common store such as ASP.NET State Service or a distributed cache.

    You can use NCache distributed cache which takes provides session sharing feature between different applications. You specify same Application ID tag for both apps inside session state settings which allows you to share session object provided you have same Session ID generated for both applications.

提交回复
热议问题