title: JSF: Clearing Session Scoped Bean
body: <p>I was wondering, How would I do <code>session.remove("userBean")</code> in JSF after user closes the window (hitting 'X' of browser) on JSF 1.2. </p>
  
  <p>I was thinking to put a confirmation pop up after user hits 'X' of browser but not quite sure how do I access or bind the <code>Ok</code> button to my defined method, where I have that logic to clear the scoped bean.  Or is there any better approach of doing this?</p>
  
  <p>Any help would be highly appreciated.</p>
  
  <p>Thanks.</p>