views:

120

answers:

1

Hi,

What is the better solution to manage Exit or Quit events when user exit to other pages with no action?. This event need to be raised only one time and be usefull to delete all temporary files or datas not stored after the abandon of this page. Is a perfect to use as cleaning method server side. Thanks.

A: 

The web is stateless so there shouldn't really be anything to clean up. However, sometimes you may want to kill the session when the user tries to close browser. I guess you could catch that event and then call the server (using AJAX) before closing the window:

http://stackoverflow.com/questions/1631959/browser-window-close-event

Not 100% reliable though IMHO!

Macka