Sencha friends,

I was wondering if there is some way to launch a function when the user exits or refreshes the browser. I'm trying to find a way to capture the event of the user leaving that session.

I plan to use this function to do an ajax request to a php file, which is hooked up to mysql. I've got the php and mysql part figured out, now i need to sencha