Here is code I wrote to do that:
<cfset timeout_minutes = 60>
<cfapplication Name="admin" SessionManagement="Yes" SESSIONTIMEOUT="#CreateTim
eSpan(0,0,timeout_minutes,0)#">
<!--- warn user of session timeout --->
<cfsavecontent variable="LogOutWarning">
~<!--- convert minutes to miliseconds --->
~<cfset timeout= (timeout_minutes-1.5)*60*1000>
~<script language="JavaScript">
~~<cfoutput>
~~<!--
~~//This function pauses, then calls your custom function.
~~myTimer=setTimeout("noTimeout()",#timeout#);
~
~~//-- This function is executed after the delay.
~~function noTimeout(){
~~~if(confirm("#TimeFormat(Now(),"h:mm:ss")#\nDue to inactivity,
your session will timeout in 60 seconds. \nClick OK to refresh
the window and continue working.")){
~~~~document.location='#cgi.script_name#';
~~~~return true;
~~~~}
~~~else{
~~~~return false;
~~~~}
~~}
~~//-->
~~</cfoutput>
~</Script>
</cfsavecontent>
<CFHTMLHEAD text="#LogOutWarning#">
Good Luck,
David Murphy
www.cfugcny.org
= = = Original message = = =
At 01:09 PM 02/11/03 -0500, Scott Wilhelm wrote:
>Does anyone have a good solution for a session timer? I'd like
to be
>able to add something to my CMS that will prompt users at certain
time
>intervals about their session status.
I was thinking one could write something in Javascript to do
this, but I'm
not sure how.
T
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4