locked
Quick timeouts (under a minute) of the session on our application hosted as a Azure Website RRS feed

  • Question

  • We are facing the problem of quick timeouts (under a minute) of the session on our application hosted as a Azure Website, even though timeouts are set to 20 minutes.

    For session we are using the "InProc" configuration of Asp.net session in our Application.

    Below is the exact configuration detail.

     

    <sessionState mode="InProc" customProvider="DefaultSessionProvider" timeout="20">

          <providers>

            <add name="DefaultSessionProvider"

                 type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

          connectionStringName="DefaultConnection" />

     </providers>

    </sessionState>

     

    We do realize that "InProc" is not the best way to do session management on a application hosted on Azure cloud.

    But still session Timeout shouldn't be so quick and frequent.

    Could  somebody help me in understanding why this is happening.

    Thursday, October 9, 2014 9:41 AM

Answers

  • Incase if you have multiple instances , and if you are using Inproc session data will not work, as its not shared across instances.

    Azure load balances your HTTP requests and may send each client HTTP request to a different server instance. Also see the below information.

    You need to use a shared session state provider, such as:
    SQL Session State provider (although I believe this has some limitations on SQL Azure as it cannot use the SQLAgent code to periodically clear the state)

    the demonstration Azure Table Session State provider (not officially supported and sometimes reported as buggy)

    the latest AppFabric Session state provider, this is the recommended one , which is in live now.

    There's a good hands-on lab in the Windows Azure Platform Training Kit called Building Windows Azure Applications with the Caching Service - I'd go through that, as one of the topics is configuring session state using the AppFabric Cache.


    Vishnu VG


    Thursday, October 9, 2014 10:19 AM
  • Hi,

    Please try to run IIS Manager with remote administration to connect with azure website, then configure the session state, refer to http://azure.microsoft.com/blog/2014/02/28/remote-administration-of-windows-azure-websites-using-iis-manager/ for more information about Remote Administration of Windows Azure Websites using IIS Manager, hope this helps.

    I agree with Vishnu, this mode is not a good choice, please consider what Vishnu said.

    Best Regards,

    Jambor


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 15, 2014 8:09 AM

All replies

  • Incase if you have multiple instances , and if you are using Inproc session data will not work, as its not shared across instances.

    Azure load balances your HTTP requests and may send each client HTTP request to a different server instance. Also see the below information.

    You need to use a shared session state provider, such as:
    SQL Session State provider (although I believe this has some limitations on SQL Azure as it cannot use the SQLAgent code to periodically clear the state)

    the demonstration Azure Table Session State provider (not officially supported and sometimes reported as buggy)

    the latest AppFabric Session state provider, this is the recommended one , which is in live now.

    There's a good hands-on lab in the Windows Azure Platform Training Kit called Building Windows Azure Applications with the Caching Service - I'd go through that, as one of the topics is configuring session state using the AppFabric Cache.


    Vishnu VG


    Thursday, October 9, 2014 10:19 AM
  • Thanks Vishnu, But we don't have multiple instances currently. When we will scale out, I will definitely think of that. Currently we have only one instance and why this is happening ? 

    Thursday, October 9, 2014 10:49 AM
  • Hi,

    Please try to run IIS Manager with remote administration to connect with azure website, then configure the session state, refer to http://azure.microsoft.com/blog/2014/02/28/remote-administration-of-windows-azure-websites-using-iis-manager/ for more information about Remote Administration of Windows Azure Websites using IIS Manager, hope this helps.

    I agree with Vishnu, this mode is not a good choice, please consider what Vishnu said.

    Best Regards,

    Jambor


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 15, 2014 8:09 AM