Execute code before browser close

Hi. I need to execute som code just before the user close the browser window(the session ends) where can i place the code Thanks in advance
[160 byte] By [joki] at [2007-11-26 8:26:43]
# 1
All client side events have to be handled on the client side. JavaScript is usually the place to handle client side events. Try searching for JavaScript event handling using your favorite search page.
jetsons at 2007-7-6 21:41:30 > top of Java-index,Development Tools,Java Tools...