cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Server side Cookies on Exiting Browser by clicking X

Former Member
0 Kudos

Hello All,

I have copied the required htm pages of SYSTEM BSP Application to my own BSP Application. Can someone tell me, which is the page which pops up, when we end the session or close the browser, with the message "Ending user session"?

My requirement is, I want to delete the server side cookies, when the user exits the application by clicking the X on the browser. I have written the code to delete the cookies, if the user clicks on Logout. I kept breakpoints on the copied session.htm, sessionexit.htm, hidden_buffered.htm, etc, but when the we close the browser directly, the window pops up saying "Ending user session", but doesn't initiate the debugger. So, I am not able to find the location, where I should write the code to delete the cookies on closing the browser.

Thank you.

Regards

Gladson

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Here's the location of the code that causes the pop-up.

CL_HRRCF_BSP_EXT_FRAMEWORK

  • exitBSPApplication() *********************************************************************************************************************

data: function_exit type string.

data: lv_exit_url type string.

concatenate lv_page_url '?sap_bsp_fw_event=exit' into lv_exit_url.

if lo_runtime->session_manager->is_running eq 0.

concatenate

crlf `function exitBSPApplication()`

crlf `{`

crlf `var out = window.open('`

lv_exit_url

`').focus();`

crlf `}`

into function_exit.

else.

concatenate

crlf `function exitBSPApplication()`

crlf `{`

crlf `}`

into function_exit.

endif.

*

Former Member
0 Kudos

Dear Stephen,

Thanks for the info, but I couldn't locate the class - CL_HRRCF_BSP_EXT_FRAMEWORK in my 640 WAS.

I have solved the problem on my own. I will mntion the solution in next post. Thank you.

Regards

Gladson

eddy_declercq
Active Contributor
0 Kudos

Hi,

Pls check these web logs:

/people/eddy.declercq/blog/2005/11/15/enemy-of-the-state

/people/eddy.declercq/blog/2006/03/20/wake-me-up-before-you-go-go

Eddy

Former Member
0 Kudos

Thanks Eddy.

Will check it out and revert tomorrow.

Regards

Gladson

Former Member
0 Kudos

Dear Eddy,

That was a very useful info, but "window.onbeforeunload" did not work for me. However, I located the trouble. Thank you for your efforts.

Regards

Gladson

Former Member
0 Kudos

Dear All,

In the session*frame.htm, the code is


<%
  CLASS cl_bsp_login_application DEFINITION LOAD.
%>
var url  = "<%= CL_BSP_LOGIN_APPLICATION=>GET_SESSIONEXIT_URL( page = page ) %>";

In GET_SESSIONEXIT_URL, the application is hardcoded.


logoff_url = cl_BSP_UTILITY=>CREATE_PUBLIC_URL(
                       application = 'system'
                       page        = 'sessionexit.htm' ).

So, although, I copied the session*frame.htm and sessionexit.htm, it is the sessionexit.htm of SYSTEM application, which is being called. That is why, the code I wrote for deleting the server side cookies, in the sessionexit.htm, which I copid to my application, didn't get executed.

Instead of making a copy of the method, I used the following work around in session*frame.htm.


<%
  CLASS cl_bsp_login_application DEFINITION LOAD.
  data url type string.
  url = CL_BSP_LOGIN_APPLICATION=>GET_SESSIONEXIT_URL( page = page ).
  replace 'system' in url with '<i>my_zapplication</i>'.
%>
var url = "<%= url %>";
url += "&wrk_sid=<%= runtime->session_id %>";

I am passing the session_id also to sessionexit.htm, as the session id of sessionexit.htm is different from the session_id of my application.

Thank you to all, who responded. I just put in my solution, so that, it will help someone else, who might face the same trouble in future.

Regards

Gladson

athavanraja
Active Contributor
0 Kudos

Hi Gladson,

Thanks for sharing!

Regards

Raja