Arun Rana
Arun Rana

Reputation: 8606

Session timeout in web application on window Azure platform

I need your help to sort out one problem with session timeout in my application which are hosted on Azure platform.

I have developed web application in asp.net and make login functionality with session and put following code maintain timeout period for session like

<sessionState mode="InProc" timeout="20"></sessionState>

It working fine on local system but when i will tested it with live URL on Azure platform it will signout frequently (session expired).

Can any one please suggest me how can i resolve this issues?

Thanks Arun.

Upvotes: 2

Views: 9418

Answers (2)

Neil Thompson
Neil Thompson

Reputation: 6425

Are you sure the session is expiring? If you are using ASP.NET forms authentication there is another timeout to consider (here I have set it to 180 mins)

<authentication mode="Forms">
  <forms loginUrl="Login/" timeout="180"/>
</authentication>

If you do have multiple instances Igorek is right - the session will not be shared.

Please see how-does-microsoft-azure-handle-session-state/1023125#1023125 or refer to the Azure SDK for more information.

Upvotes: 1

Igorek
Igorek

Reputation: 15850

Are you running more than one WebRole instance? Remember, "InProc" session-state will not be shared across multiple web-role instances. In fact, InProc session state is "evil" in the cloud world, will not work for any deployments with more than 1 instance running. You really want to use another provider, like Session provider for AppFabric Cache

Upvotes: 4

Related Questions