Why can't I share Session state between 2 web apps with StateServer? What am I missing?

前端 未结 4 396
情深已故
情深已故 2020-12-10 14:07

I\'m having trouble getting 2 identical ASP.NET MVC applications to share the same Session using a Session StateServer. The reason I\'m trying to do this is we will eventual

4条回答
  •  我在风中等你
    2020-12-10 14:35

    By default session cannot be shared between different applications. From what I can see you have two distinct applications App1 and App2 which run in separate virtual directories and probably even separate application pools, so don't expect to share session between them.

    As always there are workarounds that you may find useful. As you can see it's using a hack (reflection) to circumvent ASP.NET team designer's determination to not expose certain classes and properties and make our life as developers difficult.

提交回复
热议问题