Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

session timing out prematurely?

Posted on 2004-08-04
8
Medium Priority
?
4,293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

 

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

Independent Software Vendors: 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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

609 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