[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Session timing out randomly

Posted on 2011-10-25
8
Medium Priority
?
372 Views
Last Modified: 2012-05-12
I have a really annoying problem as it relates to my .net website/application; the session keeps timing out randomly and I cannot figure out why!

I have set the time-out properties and also on the server they are greater than 20 minutes, but time-out can occur in 2 sometimes!

 I have attached a copy of my web.config. I'd love some help on getting to the bottom of what is happening to my session!

web-config.txt
0
Comment
Question by:swgdesign
  • 5
  • 3
8 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 37024877
Session timeouts can be caused by many factors. I would recommend monitoring your app pool recycles in IIS and see if they are recycling. Also check your code for Session.Abandon() and Session.Clear() calls.

A second thing to check is if you have a load balanced server, make sure that the requests for one user are all going to the same server and that the machine.configs are the same.
0
 

Author Comment

by:swgdesign
ID: 37025624
Not using Session.clear or Session.Abandon and we are not using a load balanced server

I am just setting various session variables on login. If this is IIS related what could be causing it???

0
 
LVL 28

Expert Comment

by:strickdd
ID: 37025708
The most common causes for IIS causing this type of issue are:

1) Insufficient memory in the application pool. Minimum of 850MB per app pool for .Net 2.0+
2) Memory usage by the application. Looping connection, looping object creation, long running processes, etc.
3) Another application sharing the pool causing an issue. Isolate your applications into separate pools to find the trouble maker.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:swgdesign
ID: 37026172
The application is using it's own application pool("RBP") in IIS7 as follows;
It is integrated and using framework. 2.0 for asp.net 3.5.

Recycling...
Regular time intervals = 1740

Advanced Settings
 Screenshot of application pool settings
How do I set the memory usage for an application pool or website/application?
How do I / Whats the best way to monitor the application to see what is causing the session issue?
(I've never had to do this before so I have no idea where to begin)
0
 
LVL 28

Expert Comment

by:strickdd
ID: 37026654
This will help with the memory settings:
http://technet.microsoft.com/en-us/library/cc753179(WS.10).aspx

As far as the best way to monitor what is causing it... there is now really good way in general. It all depends on what exactly is happening. I would recommend that you enable tracing in the application and loading different pages to see where load times are taking a while and the look through the code.

I would also search for all FOR loops and WHILE loops and make sure that any used object is declared OUTSIDE the loop.

object MyLoopObj;

for(int i =0; i<someVal; i++)
{
    MyLoopObj = new object();
}

Open in new window


instead of

for(int i=0; i<someVal; i++)
{
    object MyLoopObj = new object();
}

Open in new window


0
 

Author Comment

by:swgdesign
ID: 37037217
Ok, so I reset a lot of settings this morning on my website and app pool to try and eliminate any issues, it seems to have helped but the timing out issue is still occurring. I have checked the event logs and nothing is being reported back when the website sessions time out, so am I right in thinking this is related to some code somewhere causing the time out???

You mentioned the memory settings above, but you can only set recycle values for the application pool. Is that what you meant? Also, I thought that if the values are not used, the size of memory used does not matter???

Also, the loop issue is something new to me. Is this somehting you have 1st hand experoence of causing session issues or just a guess?
0
 

Accepted Solution

by:
swgdesign earned 0 total points
ID: 37106532
Right so it seems the process idling was causing the timeout even though session timeout was set to 120 minutes!!! Stupid!
0
 

Author Closing Comment

by:swgdesign
ID: 37130006
Found out that for some reason under IIS 7 process idle timeout can sometimes cause premature session timeout!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Screencast - Getting to Know the Pipeline
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

872 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