Solved

ASP.NET Session Timeout

Posted on 2012-03-29
17
765 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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