Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where to put it?

Status
Not open for further replies.

hu68

Technical User
Feb 19, 2002
30
CA
I'm new in asp,I try to set up timeout value for session(eg: session.timeout=40) but I'm not sure where to put it ?
in global.asa session _on start event,or in any asp page?
Thanks!
 
I guess the answer to your question is another question. It depends on how you want to use it. If you want an entire site to time out after x amount of inactive time you can do that in IIS. However if you don't have access to the server you could put your timeout in the global.asa. If you want it to only affect certain pages then you would put is on those pages. I hope I made that clear.

Roj
 
Should just be Session.timeout=2 at the top of your page:

<% @ Language=VBScript %>
<% Option Explicit
session.timeout = 10 '10 minutes
%> -Ovatvvon :-Q
 
Hi,Roj & Ovatvvon
Thanks for your prompt reply.I have 3 asp pages,if I just put session.timeout=40 in the second page,it has no effect on other pages,in the first and the third page the session timeout still 20 minutes,right?
by the way ,what is the difference putting session.timeout at the top and at the end?

Hu68
 
No, from my understanding the session object is for a specific user through the entire web site of the machine. Therefore if you reset the session length on a page...I believe it will reset it for the web site...I cannot test it now, however you could write a page with a session timeout of 40 minutes on one page and 1 minute on another and test it yourself. :)

Top vs. Bottom...It's a good idea to put all your page declarations at the top of your page to stay organized...while some are mandatory like <% @ Language=VBScript %> and <% Option Explicit %>... I believe you can get away with putting others later in your document, but it wouldn't be good practice.
-Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top