weeezl
asked on
Confirm Countdown
I have a script that is for managing user sessions. Before the user's session ends, a confirm dialouge pops up asking if the user would like to renew their session.
My question is, can I have the actual alert box time out after 60 seconds if no option is selected?
Also, can the confirm box display a countdown or does this have to be done on an HTML page/window?
Here is the code:
<cfif IsDefined("url.sessionwatc h")>
<html>
<head><title></title></hea d>
<body>
<table width="100%"><tr><td align="center"><form>
Session extended.<br>
<input type="submit" onclick="window.close();" value="OK">
</form></td></tr>
</table>
<script>
window.close();
</script>
</body></html>
<cfabort>
</cfif>
<cfparam name="attributes.launchTim e" default="20">
<cfoutput>
<cfset thisLaunchTime = (attributes.launchTime * 60 * 1000)>
<script language="Javascript">
function watchSession() {
timerID = setTimeout("refreshSession ()", #thisLaunchTime#);
}
function refreshSession() {
if (confirm("Your session will timeout in 60 seconds. Would you like to extend the session?")) {
serverCall = window.open(document.locat ion.href.s plit("?")[ 0]+"?sessi onwatch=1" , "RefreshSession", "width=150, height=50");
watchSession();
}
else window.location="logout.cf m";
}
watchSession();
</script>
</cfoutput>
My question is, can I have the actual alert box time out after 60 seconds if no option is selected?
Also, can the confirm box display a countdown or does this have to be done on an HTML page/window?
Here is the code:
<cfif IsDefined("url.sessionwatc
<html>
<head><title></title></hea
<body>
<table width="100%"><tr><td align="center"><form>
Session extended.<br>
<input type="submit" onclick="window.close();" value="OK">
</form></td></tr>
</table>
<script>
window.close();
</script>
</body></html>
<cfabort>
</cfif>
<cfparam name="attributes.launchTim
<cfoutput>
<cfset thisLaunchTime = (attributes.launchTime * 60 * 1000)>
<script language="Javascript">
function watchSession() {
timerID = setTimeout("refreshSession
}
function refreshSession() {
if (confirm("Your session will timeout in 60 seconds. Would you like to extend the session?")) {
serverCall = window.open(document.locat
watchSession();
}
else window.location="logout.cf
}
watchSession();
</script>
</cfoutput>
************************** ********** ********** *********
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
************************** ********** ********** *********
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area:
RECOMMENDATION:
- [PAQ No Refund]
Please leave any comments here within the next seven days.
************************** ********** ********** *********
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
************************** ********** ********** *********
jAy
EE Cleanup Volunteer
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
**************************
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area:
RECOMMENDATION:
- [PAQ No Refund]
Please leave any comments here within the next seven days.
**************************
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
**************************
jAy
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You will have to mimic the dialog box with a new window. You could get it really close if you press the print screen button, and slice up the dialog box image. Could look really fancy.
Sorry
J