You should have no problems setting a persistent variable and checking it
to timeout their session, and you certainly *could* use that to fire JS
code like you've demonstrated, but I recommend that you choose a different
action.  I recommend that if you time them out for inactivity, redirect
them to the login page instead.  I know that it would be very frustrating
for me to have you close my browser window when all I have to do is
re-login.

You might also want to post this to CF-Talk or CF-Community to get a wider
audience.  CF-Server isn't as widely read as those other two.

Either way, your basic flow is:

1.  in application.cfm (or one of the app_ files if you're using Fusebox),
use cfparam to set your activity time variable with its initial value.
2.  further down in the page flow (possibly even within the same file),
check the value of that time variable.  If the value is within your timeout
period, then update the value to Now(), since they're still active in the
app within the timeout.  If they're not within the timeout, fire your
redirect or whatever you choose.

The specifics of variable scope, etc. will depend on whether you're using
client or session variables and other such things.
|-----------------------------+-------------------------------------------|
|Eric A. Laney                |"Only the shallow know themselves."        |
|Systems Engineer             |                                           |
|LAN Optimization Team        |                                           |
|Voice: 813.978.4404          |                              - Oscar Wilde|
|Pager: 888.985.8519          |                                           |
|-----------------------------+-------------------------------------------|





                                                                                       
                                                 
                    "Roberts, William C"                                               
                                                 
                    <[EMAIL PROTECTED]        To:     CF-Server 
<[EMAIL PROTECTED]>                                     
                    oeing.com>                      cc:                                
                                                 
                                                    Subject:     Using CFAPP and 
inactive interfaces...                                 
                    07/24/2001 12:36 PM                                                
                                                 
                    Please respond to                                                  
                                                 
                    cf-server                                                          
                                                 
                                                                                       
                                                 
                                                                                       
                                                 





Please help!

Anyone have any good examples of using cfapplication to automatically close
the browser window after 20 minutes of inactivity?

This is what I have so far:

1. Authentication is handled via the Web server so I have #REMOTE_USER#
available to me.

2. If someone navigates my app after the timeout period (say 20 minutes) I
would like the following code below to run...
===========================================
<script language="JavaScript"><!--
alert('You do not have an active\nconnection with the System.\n\nThis may
be
due to\n20+ minutes of inactivity.\n\nIf you wish to continue
working,\nplease login again.');
self.close( );
//--></script>
<cfabort>
===========================================

I need help ASAP!  Anything would be greatly appreciated!  Thanks!
Bill
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to