0

We need to logout the user on the event that they close the browser. The following URL shows how to do this using redirection:

http://www-01.ibm.com/support/docview.wss?uid=swg21228490

Since the browser is already closed, we need an equivalent that we can call without using redirection. We need to do this using server-side code.

1 Answers1

1

If your app can keep track of the user sessions IDs, you can call: server task your_instance_on-webseald-host terminate session session_id within the pdadmin utility.

More details here.


Another solution: attach JS on the page to the window.close event and trigger an AJAX get of pkmslogout.

CarHa
  • 1,148
  • 11
  • 31
  • Thanks for your answer. Unfortunately we don't have access to the pdadmin utility. Our account does not have the necessary privileges. We can't use close or unload event because it is also triggered on refresh or back events. This will logout the user on refresh. – John Tolentino Sep 01 '15 at 02:45
  • What's your use case? Web app or mobile app? And if mobile app: is it hybrid mobile or native? Also: this could be helpful as well https://stackoverflow.com/questions/1631959/how-to-capture-the-browser-window-close-event – CarHa Sep 01 '15 at 04:32
  • Webapp. Yes, we've seen that thread. That's why it led us to consider a server-side implementation of logging out the user. – John Tolentino Sep 01 '15 at 06:11