سؤال

Is there any setting in Open SSO which can destroy the user session when the user closes the browser window. I know by plain JavaScript we can add the window.onbeforeunload but that is no guarantee.

هل كانت مفيدة؟

المحلول

No. There's literally no guaranteed way to find out whether the user closed the browser window - unless you establish a poll and listen to a heartbeat emitting from client side JS (an ajax call to your server) periodically.

Upon sever not getting the heartbeat for some time, you can conclude that the browser window was closed/crashed.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top