!--a11y-->
Logging off BSP Applications 
A logging off scenario is vitally important for stateful BSP applications, since the BSP runtime is not able to carry out session management itself. The BSP runtime cannot determine when an application has ended.
Without a logging
off scenario, numerous SAP Web AS sessions could remain open and therefore use
up memory capacity and similar system resources, even if they are not actually
required. The open and inactive sessions remain to exist until
they are closed by default by the
Internet Communication
Manager. This then overloads
the application servers.
The cure for this problem is a simple logging off scenario that is created as a protective frame for the session around the respective BSP application. If you implement the logoff scenario, the SAP Web AS session is ended when a user calls up a different URL in the browser, for example, or closes the browser. The session is ended using the automatic send command sessioncmd=close to the SAP Web AS in a new frame, which is then automatically closed afterwards.
The pages for the logoff are components of the BSP application SYSTEM.
· You are using an SAP Web AS 6.20 system and have implemented at least Support Package 4.
· Your BSP application is running in stateful mode.
BSP application SYSTEM contains the following sample pages for logging off:
· session_single_frame.htm
The BSP application is processed in the browser in its own browser frame. If you close the browser or call a different URL, this closes the session that is running in the background.
· session_buffered_frame.htm
The BSP application in the browser consists of two different browser frames, where the system always switches between the two frames, which minimizes setting up the screen repeatedly. If you close the browser or call a different URL, this closes the session that is running in the background.
...
1. Copy one of the two logoff pages (either session_single_frame.htm or session_buffered_frame.htm) to your own BSP application, such as in the name session.htm.
2.
Change the line after the
page directive so that target_page points to the actual start page of your BSP
application, which should be executed in the browser frame:
<%
DATA: target_page
TYPE STRING VALUE 'default.htm'.
%>
3. Now branch to the Properties tab in your BSP application and specify the logoff page (in this example it is session.htm) as the Initial BSP for your BSP application.
4. If necessary, replace the default simple “Loading” layout with a more complex layout that is suitable to your application.
5. Save and activate your page and the BSP application.
