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.
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?
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.