Solved

ASP.NET Session Timeout

Posted on 2012-03-29
17
764 Views
Last Modified: 2012-04-23
I have an ASP.NET webiste I developed.  I have the following in my web.config file.

      <sessionState cookieless="true" timeout="20" />

However, it seems my session is timing out after 3 mins.  Any ideas how to resolve?
0
Comment
Question by:CipherIS
  • 10
  • 3
  • 2
  • +2
17 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 37784131
It could be in your IIS.  Ensure the worker process is not recycling.
0
 
LVL 7

Expert Comment

by:Lalit Chandra
ID: 37784160
Chances are the worker process is recycled meantime, Where do you store the sessions?
Making your sessions stored out of process may helps.

you can also know about another settings quickly from the nice article below

http://ramanisandeep.net/2011/03/19/tipstrick-session-timeout-problem-in-iis7/

Hope this will help.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37784271
Thanks but that did not solve the problem.

Application pool’s Idle Time-out = 20 Mins

Session State Mode Settigs Values
-  In PRocess

Cookie Settings
- Mode = Use URI
- Regenerate expired session ID = true

Use hosting identity for impersonation = true
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37784304
Do you have any calls to Session.Abandon in your code? If you do, perhaps one is being triggered inadvertently, which forces a new session on the next request to your site by a given user.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37784315
No - i don't have Session.Abandon in my code
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 37784318
What specific behavior are you witnessing?
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37784341
i click on a button which redirects me to a page.  I wait 1 minute - click on another button which goes to another page - no problem

I repeat above but wait 3 mins before clicking on button for redirect and the session is expired.
0
 
LVL 21

Expert Comment

by:masterpass
ID: 37784436
Do you perhaps have an inactivity detector in Javascript?
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37787133
no - i don't
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37787694
There is an error msg on the server in the Logs which says:

Session state is not available in this context at System.Web.HttpApplicaitonFactory.EnsureAppStartCalledForIntegratedMode (HttpContext.context, HttpApplicaiont app) at System.Web.HttpApplicaiton.RegisterEventSubscriptionWithIIS(InPtrSystem.Web.HttpApplication.RegisteredEventSbscriptionWithIIS .....
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37797027
Anyone have any ideas?
0
 
LVL 7

Expert Comment

by:Lalit Chandra
ID: 37797127
r u using Asp.net Session object in Global.asax.cs file ??
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37801679
No.  I tried to add it but it gave me an error.
0
 
LVL 7

Expert Comment

by:Lalit Chandra
ID: 37802409
please provide the full information or post the code that you think is the root cause of this problem. Is this session timeout issue happen on every page or any specific page or any specific event ??
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37838414
still troubleshooting.
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 37863160
It seems to be a problem with the VM.  I copied the code to prod and not having the issue.  Something has to be recycling to cause the problem.
0
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 37880023
its an issue on Dev server where worker process is recycling
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question