I am building a web based (ajax) IM application that connects web visitors with webmasters called SNIMMER. The problem that we have encountered is that during an IM session if a user clicks on the browser "Back" button the session terminates. I imagine this is standard javascript behavior - clicking on "Back" button resets existing javascript state and breaks the IM session.
Even preventing the "Back" click with a javascript pop-up does not work. While the user receives a js alert and has a choice to remain on the previous page - it still re-sets the javascript state and the IM session is lost. The same problem also arises when a user wants to closing the browser. We can generate a pop up, but cannot preserve the existing session.
Does anyone have any suggestions on how to tackle this? Is there a way to deal with this in javascript or flash?