One way to handle this problem is to create a parent window whose function is to open a child window for working and be available to nag the user into logging out if the user closes the work window directly.
Welcome to the login page. <form> <input type="button" name="doit" value="Press to simulate log in"? onClick="javascript:window.location='nag.cfm';"> </form>
Here is where you would add code to remove the session from memory; call it bye.cfm.
You've passed through a page (bye.cfm)<br> that would remove your session variables from memory.<br> <script language="javascript"> window.location = 'homepage.cfm'; </script>
Here is where the user will "work"; call it work.cfm. It gives the user a button that will shift the focus to the nag page that invites the user to log out.
Here's your work page. When you're tired of admiring it,<br> click "Done" (or find nag.cfm). <form> <input type="button" name="leave" value="Done" onClick="opener.window.focus();"> </form>
First, prepare to open the work area. openchild1 names a new window "myChild1" when it creates it so we can use the name later to close it. Note that the features parameter that contains attributes such as toolbar and location (URL window) cannot have any spaces within it.
<head>
<script language="javascript">
function openchild1(mypage) {
myChild1 = window.open('work.cfm','myWindow',
'toolbar=yes,location=yes,scrollbars=yes,resizable=yes');
}
Next, prepare to close the window when asked.
function leave() {
if (!myChild1.closed) {
myChild1.close();
}
window.location = 'bye.cfm';
}
Finally, close the script tag and set the body to open the work window when the page has finished loading and to try to close it when the user logs out.
</script>
</head>
<body onLoad="openchild1('work.cfm');">
<form>
<input type="button" name="doit"
value="~~~ L O G O U T ~~~" onClick="javascript:leave()">
</body>
Expand the concept and make it nicer, but be sure you can use your method for major versions of both major browsers. [grim grin] Then, please tell us what you've learned so we can build on higher ground. =Marty=