About Jeff Allen Expertise I can answer basic to intermediate questions related to Classic ASP.I can answer Intermediate to Advanced questions CSS& HTML, and basic questions about JavaScript and Ajax. I can also answer questions related to web page accessibility under US Section 508.
Experience I have 8 years experience with HTML. I have been developing in ASP, VBScript and CSS for two years each. I also currently work as web developer.
Organizations IWA-HWG
Education/Credentials I have a BA in English with minors in Web Design and Scientific and Technical Writing
Expert: Jeff Allen Date: 11/7/2006 Subject: Session time out
Question If I set session timeout to 10 min. It will automatically ends the session. But I want to give alert message to user with OK and Cancel buttons. If he clicks OK it will keep the session alive. If he clicks cancel it will drops the session.
-------------------------------------------
The text above is a follow-up to ...
-----Question-----
In my application we don't have session timeout. Now we want to implement it. If the user has not accessed the application or not triggered any every for certain period of time(for ex: 10 min) then I want to show a message asking user to continue the session or not. If user wants to continue I need to reset the timeout variable other I need to redirect the control to Login form.
Could you please tell me in what way I can do this in ASP
-----Answer-----
In Classic ASP you'd set the Session.Timeout for 10 minutes. Normally, by default it is set for 20 minutes. You'd set it like so: Session.Timeout (= intMinutes) so, to set it for ten minutes you would just use Session.Timeout = 10 to set the timeout to 10 minutes.
Answer I'm not sure if you can do this using ASP or not but you can do it using client-side JavaScript very similar to this:
//5 min warning
if (lMins==5 & lSecs==0) {
alert('You will be automatilly logged out in 5 minutes. Please save you work now to ensure no work is lost.');
}
//timeout warning
if (lMins==0 & lSecs==0) {
alert('You session has timed out. You will need to login again. Please make a copy of your work before you do anything else as it may be lost.');
}