Yup, because the server has no idea the browser was closed. Your browser does not send a message to all the websites you have visited and say "I am closing now, please run any code you like now because I am closing...."
What happens with using J2EE or other methods that create "memory" cookies that are not saved and thus forgotten when the browser closes is that the user can no longer connect to any previous sessions, so the session is abandoned when the browser closes. The session will timeout when it is schedule to and any code set to this even will run. You can try to use JavaScript and onBlur or other end type events in the code running in the browser. I am not a fan of these as they are problematic, easy to circumvent and not very cross browser complaint. But if your requirements are narrow enough they may work for you. Ian Paul Henderson wrote: > >From what I understand if you set the cfadmin to use J2EE Session variables > sessions will expire when the browser is closed. However I've been testing > this out and the OnSessionEnd code I have in the application.cfc does not > run when the browser is closed it only seems to run when the session times > out. Is there a way to trigger the OnSessionEnd when a user closes the > browser? Thanks. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281686 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

