How to trigger Logoff apart from closing browser
I have implemented session handling by copying the page session_single_frame.htm from the system bsp into my application. This works fine if the user closes the browser or types in another url. Their SAP session ends properly and they get a small window, only very briefly, which says Ending user session.
My logoff button does the following:
navigation->exit( 'logoff.htm' ).
Logoff.htm contains the following which I copied from another SAP page. URL is a page attribute which I set in OnInitialisation to the url I want to navigate to.
<title> Update Window </title>
CLASS cl_bsp_login_application DEFINITION LOAD.
url = cl_http_utility=>escape_url( unescaped = url ).
var url = "<%=CL_BSP_LOGIN_APPLICATION=>GET_SESSIONEXIT_URL( page = page ) %>";
url += "&<%=CL_BSP_LOGIN_APPLICATION=>CO_BSP_APPLICATION %>=<%=CL_BSP_LOGIN_APPLICATION=>SET_LOGOFF_URL_PARAM( url = url ) %>";
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
I have also tried using the default.htm page from system ITSM. I could not get this to end the session if the user closed the browser though. I tried both onUnLoad as well as onBeforeUnload. Neither worked so I went back to using session_single_frame.htm from system application.
Thanks for any help you can provide.