If  you have J2EE enabled you can create a HttpSessionListener
implementation which clears the directory when it receives a
sessiondestroy callback.  This will do your cleanup automatically and
does not rely on client-side scripting which sometimes doesn't work:
(Examples: computer shuts off/unplugged, User kills the app, non
standard browsers, etc).


-Dov

Dov Katz
Enterprise & Client Technology
Morgan Stanley
750 7th Avenue | 34th Floor | NYC 10019
[EMAIL PROTECTED]

  _____  

From: S.Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 22, 2004 9:27 AM
To: CF-Talk
Subject: Re: Kill window Kill session

> I have a web app that requires a username and password.
> When the user logs into the application, a directory is
> dynamically created for that user.  when the person uses
> the logout button, the directory and all the files
> included in it, gets deleted.

> The problem i am having is when users 'X' out of the
> application rather than using the logout function.  The
> session get destroyed, but the directory and the files in
> it will not be deleted.

> Any ideas????

Unfortunately the only way to resolve this will be to employ a
_javascript_ tactic which will prevent the user from being able to use
their refresh or back buttons while they're using the application.
Open the application in a fameset or an iframe. Then add an onunload()
and onbeforeunload() event (for IE because IE handles it in a
non-standard way) to the top window which launches the logout page in
a separate frame or iframe. When the user closes their browser
(without hitting the logout button - or if they refresh or go back),
it will automatically load the logout page that frame or iframe prior
to closing the browser. Popup killers won't affect it because it's not
a popup, although you do need to be sure that users have _javascript_
enabled before they log-in, which can be done by dynamically
populating the login form. In other words, when they go to log in, the
page presents a "we're sorry, you must have _javascript_ enabled"
message. Then a bit of _javascript_ replaces that message with the
log-in form. If you need help with any of this I've done it before
myself, so just let me know.

s. isaac dealey   954.927.5117

new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477&DE=1
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to