[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

session timing out prematurely?

Posted on 2004-08-04
8
Medium Priority
?
4,298 Views
Last Modified: 2008-01-09
I'm sending a link in an email that has a session id embedded in it to allow a download for a set period of time. Now the link seems to work fine for the first five minutes but after that I get the following error
"Object reference not set to an instance of an object"

Programtically I'm setting the Session to a full day as follows
Session.Timeout = 1440;

but the web.config file is as follows:
<sessionState
            mode="InProc"
            .......
            .......
            cookieless="true"
            timeout="20"
    />

So the questions are does the web.config's timeout override the programmatic timeout of 1440. If so, the link is going bad after 5 minutes not 20? What could be the problem?
0
Comment
Question by:dotnet22
  • 3
  • 3
  • 2
8 Comments
 
LVL 10

Expert Comment

by:Clif
ID: 11716371
You need to set the app script timeout for the particular virtual directory you're using.

In the Properties pages for any Web site or Web virtual directory

Click the Home Directory or Virtual Directory tab.
Under Application Settings, click Configuration. An application must be created for the button to be active.
Click the Options tab.
Type the length of time (in seconds) for an ASP script to time out in the ASP Script timeout box.
0
 
LVL 10

Expert Comment

by:Clif
ID: 11716397
Oops,

Not app script timeout.  It's asp script timeout.
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11716456
TimeOut in web.config is what IIS follows. Default is 20. It is definitely overriding what you coded...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:dotnet22
ID: 11716508
DotNetLover,

If this is the case, it still times out before the 20 minutes. So what I'm wondering is what event is raised when all session variables are disposed of? What event would this be in the Global.asax file. I could send out an email to myself when this event is raised but how would I know what caused this restart? Basically the source of the restart?
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11716710
0
 

Author Comment

by:dotnet22
ID: 11717792
I think I found the cause of the premature case: I was uploading a new application which causes everything to be reset. Duh. But then another question is if
Sesstion.Timeout is overridden by the timeout value in the web.config file, then what is the point of the Session.Timeout value? If I set the web.config file timeout to 30 minutes and set the Session.Timeout=10 minutes, then which one will be the valid one? The 10 minutes or 30 minutes?
0
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 2000 total points
ID: 11717967
well.. you got it wrong... what I meant is... It shouldn't override the value you specify in the code. But in your case it was doing so. If the application is restarted IIS will go by the TimeOut value in the web.config.

>>If I set the web.config file timeout to 30 minutes and set the Session.Timeout=10 minutes, then which one will be the valid one? The 10 minutes or 30 minutes?<<

the answer is 10 mins... as long as there is no change/restart in the application.
0
 

Author Comment

by:dotnet22
ID: 11718089
I thought it was because I was uploading a new application. but this doesn't seem to be the case because I haven't done so but the link has gone bad anyway. Is there something in the Global.asax events that is triggered when all sessions or restarts are triggered. I could basically email myself a message and possibly try to find the source of the restart?
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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

829 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