locked
ASPState Session state database in In-Memory RRS feed

  • Question

  • User-46109667 posted

    As ASPState In-Memory introduced, am migrating the sql server session state to ASPStateInMemory.  
    Our website has multiple application hosted under single site and all applications need to share the same session from the sql server db. The current hosted website uses sessionstate mode as sqlserver and all applications are grouped with a application name. So there is no problem in current structure.

     <sessionState allowCustomSqlDatabase="true" mode="SQLServer" sqlConnectionString="xxxxxx;Application Name=SessionTest;" timeout="180" cookieless="false"/>

    As I tried to migrate to ASPStateInMemory (Microsoft.Web.SessionState.SqlInMemoryProvider) the session state is not getting shared by the applications. A new session is getting created for every application.

    My website structure would be like:

    |- RootWebsite(having the login page)
          |-application1
          |-application2
          |-application3

    Note:
    We have created the ASPStateInMemory database, and added SqlInMemoryProvider to our application with .net framework 4.5.
    The problem is all the applications are not sharing the same session db.

     Can someone help me to handle multiple applications using new In-Memory structure?

    Friday, June 22, 2018 2:37 PM

All replies

  • User283571144 posted

    Hi RagavanB,

    As far as I know, the sql in-memory could be used in Web Farm and Web Garden scenarios

    According to your description, I couldn't directly find the reason why the in-memory session state doesn't share the session.

    Could you please post the web.config you have used now?

    Do you install the newest the Microsoft. AspNet. SessionState. SqlSessionStateProviderAsync package?

    About how to use it, you could refer to this article.

    If you could post more details information, it will be more easily for us to find the solution.

    Best Regards,

    Brando

    Monday, June 25, 2018 9:21 AM