cancel
Showing results for 
Search instead for 
Did you mean: 

Destroy the session automatically when the browser is closed by user

NiklasL
Explorer
0 Kudos

Is it possible to automatically destroy a session when the browser is closed by the user with the X?

Basically, what we want to do is to create the same effect when the user is closing the browser (with the X button) as when the ordinary log out button is used. That is to have the session destroyed.

Any ideas?

/Carl-Johan

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184494
Active Contributor
0 Kudos

Hope this helps...

Refer note : 904155

-


from SAP Note 904155----


Symptom

A BSP application is not terminated correctly when the user closes the browser window or navigates to other URL.

The popup window, which appears on browse closure, contains the

text representing <img> HTML element content in the escaped

form, like that:

<IMG WIDTH=quot; HEIGHT=quot; SRC="...

After the popup disappears, the session remains opened.

Since the session is not removed, that may result in database locks that still remain and can be found in transaction SM12.

Other terms

Business Server Pages, WebAS, sessionexit, session termination, SM12, SM04, SYSTEM, session_single_frame.htm

Reason and Prerequisites

Reason:

The problem is caused by the minor code inconsistency in BSP application SYSTEM -> page SESSIONEXIT.HTM.

Prerequisites:

1. The application is using the SYSTEM application page SESSIONEXIT.HTM for logoff. When it runs, suddenly HTML source code appears on the logoff screen.

2. SAP_BASIS 620 SP57 or SAP_BASIS 640 SP15 or SAP_BASIS 700 SP06 are installed.

Solution

Please install SAP_BASIS 620 SP58 or SAP_BASIS 640 SP16 or SAP_BASIS 700 SP07

or

apply the code correction as described below:

1. Go to BSP Application SYSTEM.

2. Select page SESSIONEXIT.HTM and turn on Change mode.

3. Change the line:

<%=application->session_exit( exit_url = app-exit_url namespace = app-appl_ns name = app-appl_name page = app-page_name )%>

to:

<%raw=application->session_exit( exit_url = app-exit_url namespace = app-appl_ns name = app-appl_name page = app-page_name )%>

Arun

P.S Assigning points is a way of saying thank you on SDN

Message was edited by: Arun Varadarajan

former_member191062
Active Contributor
0 Kudos

Hello,

You just need to copy the page 'session_single_frame.htm' from the standard BSP application 'SYSTEM' to your application, and make use it as start page. It contains a session handler wrapper frame. The only thing you have to modify is the name of the target_page. /* If you opent this

page in SE80 evrything is described there */

Regards,

Dezso

eddy_declercq
Active Contributor
0 Kudos

Hi,

Pls check weblogs like:

/people/thomas.jung3/blog/2004/11/09/updated-stateful-bsp-applications-new-state-management-option

/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

eddy_declercq
Active Contributor
0 Kudos

Hi,

Pls don't forget to reward points and close the question if you find the answers useful.

Eddy