RIYAZ
RIYAZ

Reputation: 31

Asp.net Session Expire soon on live Web server

I am facing a problem about web application,

I have lost session too soon

, I have already set timeout and that related things.

it is done when I have uploaded it on

LIVE SERVER

, after spend some time I not able to use session, it redirect me on Login.

Please tell me what i can do?

Thanks

Upvotes: 2

Views: 2214

Answers (3)

sGermosen
sGermosen

Reputation: 374

All servers/hosting have a configuration environment, obviously if your problem passes in dev you need to solve it there, but if is only happening in the server maybe could be for server configuration from your provider, for example, almost all providers by default when you create an application from Plesk set timeout on session for 20 minutes, so, that's could be the problem of anybody than have the same issue.

Upvotes: 0

Suraj Singh
Suraj Singh

Reputation: 4069

Sorry i have to reply as answer not comment ,

Type “inetmgr” in run window to open IIS from left pane “Connections” select your application. right click on your application and refer the image to open “Advanced Settings” of application(to check which ApplicationPool is referred by application )

from “Application Settings” window you can see the Name of ApplicationPool. like Asp.net V4.0, DefaultAppPool, Asp.net V4.0 Classic.

Right click on the ApplicationPool that was assigned to your Application and click on "Advanced Settings...."

in the popup window ... check the Idle time out for ... that cause the timeout while web application is idle.

enter image description here

Upvotes: 3

volpav
volpav

Reputation: 5128

There're multiple ways why ASP.NET session state can be lost. The most common one is when the application pool recycles. This, in turn, can be due to IIS configuration (scheduled recycles), changes to the /bin folder or web.config file (can also be an anti-virus software that "touches" the files).

In case the session state is maintained using cookies, there can be situations when the browser doesn't accept them (and therefore, doesn't pass them back resulting in a new session created every time). You can verify that the cookies are sent (and that the value is not changing within the same session) by using Fiddler or F12 tools of your choice (the name of the cookie is ASP.NET_SessionId).

You may also check the sessionState configuration element in your web.config file to make sure those settings are correct (more on the subject: MSDN article).

Also, check the Event Log ("Application" log where the "Source" would be "ASP.NET X.X.X.X" where "X.X.X.X" is the framework version). In cases like this, there's usually some useful information in there.

Hope this helps.

Upvotes: 0

Related Questions