Sharing SQL Server Session State across Web Applications

后端 未结 2 2055
挽巷
挽巷 2020-12-30 09:16

I\'m setting up a very basic demo of SQL Server Session State, but am having some trouble getting it working. I\'m trying to test this out locally running Windows 7 with IIS

2条回答
  •  说谎
    说谎 (楼主)
    2020-12-30 10:09

    The problem you have is sharing session state across ASP.NET applications. This is not supported out-of-the-box with SQL Server session provider. See this SO post regarding what changes to make to SQL Server session provider to support cross-application sessions.

    I would not use session for managing this shared state (i.e. LastSiteUsed). This information should be persisted with the user profile store (Membership, Profile provider, custom DB, etc.). Since session can expire - using a shared session across applications isn't a reliable mechanism to track persistent user-specific state. If persistence isn't critical than utilize the AppFabric Cache for an in-memory cross-application shared state.

提交回复
热议问题