?
Solved

Session dropping at random and always prematurely

Posted on 2006-05-25
14
Medium Priority
?
416 Views
Last Modified: 2010-06-21

I've developed an application for our in-house use and it works nicely, except that the session are dropped by the server prematurely at random and no reason
is given.This is a problem since most of the time users spend in the admin and I need the sessions there.
 
- There are no entries on the server in the application logs or other logs.
- The bin folder is not being updated or written to.
- As far as I know the application is not recompiled by the server. (guess)
 
So my question is, how to find out the reason for the problem ? What are the reasons for this ?

Though it might not be necessary, I've also attached a sample application that shows how the other application was developed - it's just 5 pages but shows the
concept. In case there is something wrong with that :)

Available here: http://www.helpconnection.net/_Sample.zip

Thanks for your help.
0
Comment
Question by:vpekulas
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 16762922
Check your IIS settings and see if you have an application pool set up for this site. If so, make sure it is not recycling as often. This is usually the cause.
0
 

Author Comment

by:vpekulas
ID: 16763419
This has happened now on 3 different server, including the dev machine where there is no application pool set-up.
0
 
LVL 28

Expert Comment

by:strickdd
ID: 16763698
Make sure you don't have Session.Abandon() anywhere in your code.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Accepted Solution

by:
quanmac earned 1500 total points
ID: 16764522
In your web.config file, check the:

 <sessionState
            mode="StateServer"
            ...
/>

Set it to StateServer instead of InProc, state server should be more stable than InProc, but it does require data that gets stored into session values be serializable.

I had a similar problem and after I switched to StateServer, I haven't had any problems with sessions being dropped at random times.
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 16766750
are u using relative paths in all places where u r redirecting the user to a new webpage .. if not, the session gets dropped ..

Rejo
0
 

Author Comment

by:vpekulas
ID: 16768851
Hi Guys:,

Rejo - yes, the users stay only within the application pages and don't leave. When I redirect I use relative URL's most of the time. E.g.:
Response.Redirect("../../index.aspx", True)

Quanmac  - I'll give this a try, though isn't it just hiding the real problem ? I mean even with InProc it should work ....

strickdd - I use the Session.Abandon() only on the user logg out, no where else, this is not the cause of my problem.


Thanks you for your input so far ! Any more ideas ?
0
 

Author Comment

by:vpekulas
ID: 16779646

Any other ideas ? :)
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 16782653
>>When I redirect I use relative URL's most of the time
most of the time?? so is the code for the other cases gettting fired anytime here .. note that session is lost if u redirect without using the relative path ..

Rejo
0
 

Author Comment

by:vpekulas
ID: 16783818
Most of the time because I might have used a full URL, but if you are getting to sessions being domain specific, then the application never leaves it's place, the sessions are set and read from the same place.
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 16787285
>> if you are getting to sessions being domain specific ..
no .. but when u give the complete URL for redirection .. its as good as navigating to a new website and so a new session id is generated .. try changing them and verying whether they were the problem area ..

Rejo
0
 

Author Comment

by:vpekulas
ID: 16789631
I'll have to test it, but I'd be very surprised if that was the case. The URL (domain) would have to be different from the one being redirected for the session to be dropped. For example missing www would do that ....
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 16970289
using the full path for redirection would be the problem for dropping sessions and I have mentioned that above ..
0
 

Author Comment

by:vpekulas
ID: 16970318
Rejojohny: Would be but that wasn't the case, I never used full URL's.

I never found out why it keeps on doing that, but switched to <sessionState mode="StateServer" cookieless="false" timeout="20" />
which took the session state out of the application process. Solved the problem for now, I'm just hoping it doesn't only hide the cause.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

862 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